Cómo formatear archivos JSON grandes (más de 50 MB) sin que se bloquee tu navegador

June 26, 2026 · 5 min read

A client once sent me a 47MB JSON file exported from their analytics platform. "Can you make this readable?" I pasted it into a browser formatter. The tab froze for 14 seconds, then Chrome killed it. Here's what I learned about handling large JSON in a browser.

Why Large JSON Freezes Browsers

When you call JSON.parse() on a 50MB string, the browser has to allocate memory for the entire parsed object tree in one shot. A 50MB JSON string becomes roughly 150-200MB of JavaScript objects in memory — every string, number, array, and nested object gets its own allocation. Chrome's per-tab memory limit is around 2-4GB depending on your device, so a single large parse won't crash it, but the synchronous parsing blocks the main thread, freezing the UI for seconds.

Most online formatters compound this by sending your JSON to a server first, then downloading the formatted result. For 50MB files, that's a 50MB upload + 50MB download + server processing time. A browser-local formatter skips the network entirely.

Practical Limits

Based on testing: files under 5MB format almost instantly. 5-20MB takes 1-3 seconds. 20-50MB takes 3-10 seconds depending on your device. Above 50MB, consider splitting the file or using a streaming parser. Formly's JSON formatter handles up to ~50MB comfortably in Chrome and Edge. Safari and Firefox have slightly lower limits due to different JS engine memory management.

When to Split Instead

If you're dealing with a 100MB+ JSON file, use jq on the command line to split it into manageable chunks. Or open it in VS Code with the Prettier extension, which uses a native JSON parser that's more memory-efficient than the browser's JavaScript parser.

Sam TaylorWritten by Sam Taylor — Full-Stack Developer. More about me →