How to Open and Search Huge JSON Files (100 MB+)
· 5 min read
To open a huge JSON file, use a viewer that parses in a background thread and renders only the visible rows, such as our large JSON viewer, or skip the UI entirely and stream the file with jq or Python's ijson. Regular text editors and the browser's built-in viewer struggle because they try to lay out or syntax-highlight the whole document at once.
Which approach fits depends on what you need: look around, find one record, or extract data for another tool. This guide covers all three.
Why big JSON files freeze tools
- Memory blow-up. A parsed JSON document takes several times its file size in memory, because every object, string and number becomes a separate in-memory value with overhead. The exact factor depends on the runtime and the data shape.
- Rendering. Editors that syntax-highlight, fold and measure every line, or tree views that create a DOM node for every key, slow down sharply with millions of nodes.
- One long line. Minified JSON is often a single line of tens of megabytes. Many editors handle long lines far worse than many short ones.
- Main-thread parsing. A web page that calls
JSON.parseon 200 MB on the main thread blocks all interaction until it finishes.
Choose the right approach
| Goal | Best tool | Why |
|---|---|---|
| Browse structure, expand nodes, search keys | Large JSON viewer | Worker parsing and virtualized tree: only visible rows exist in the page. |
| Pull out one value or a filtered list | jq or a JSONPath query | Returns a small result you can read. |
| Process every record with constant memory | jq --stream, Python ijson | Streaming parsers never hold the whole document. |
| Repeated analysis of the same data | Convert to NDJSON or load into a database | Line-based formats split, grep and parallelize easily. |
Option 1: a viewer built for large files
Our large JSON viewer reads the file locally (nothing is uploaded), parses it in a Web Worker so the page stays responsive, shows progress, and renders a virtualized tree. You can collapse to a depth, search keys and values, and copy the path of any node for use in a query. Practical limits come from your device's memory; a laptop with 8 GB or more of RAM typically handles files in the low hundreds of megabytes. For the general-purpose tree on small and medium files, use the JSON viewer.
Option 2: query it with jq
jq loads the document into memory but is far leaner than an editor and prints only what you ask for. Start by learning the shape:
# Top-level type and keys
jq 'type' big.json
jq 'keys' big.json
# How many items in an array at the top level
jq 'length' big.json
# First record only, pretty printed
jq '.[0]' big.json
# All records where status is "failed", compact one per line
jq -c '.[] | select(.status == "failed")' big.json > failed.ndjsonIf you know JSONPath better than jq, test the expression on a small sample in the JSONPath tester first. The JSONPath cheat sheet and jq vs JSONPath cover the syntax.
Option 3: stream it when it will not fit in memory
For files that are too big to parse at once, use a streaming parser. jq's --stream mode emits [path, value] events instead of building the document. This idiom turns a huge top-level array into one record per line:
jq -cn --stream 'fromstream(1 | truncate_stream(inputs))' big.json > records.ndjsonIn Python, ijson iterates over items lazily. The prefix item means "each element of the top-level array"; use results.item for an array under a results key:
import ijson # pip install ijson
failed = 0
with open("big.json", "rb") as f:
for record in ijson.items(f, "item"):
if record.get("status") == "failed":
failed += 1
print(failed)Memory use stays roughly constant no matter how large the file is, because only one record is in memory at a time. Note that ijson returns non-integer numbers as decimal.Decimal, which is exact but needs converting before you serialize with json.dumps.
Option 4: convert to NDJSON for repeated work
Once records are one per line (the output of the commands above), standard Unix tools work again: head -n 100 for a sample, grep for a quick search, split -l 100000 for chunks, and wc -l for a count. Many data tools (DuckDB, BigQuery, Spark, pandas with lines=True) read NDJSON directly. See what NDJSON / JSON Lines is for details.
Quick searches without parsing
If you just need to know whether a value appears, plain text search is fastest. grep -c "order_123" big.json counts matching lines, and grep -o with a pattern can extract fragments from minified files. It does not understand structure, so confirm hits with a real query.
Tips for very large files
- Close other heavy tabs before opening a large file in the browser, and prefer a desktop browser over mobile.
- If the data contains credentials or personal data, keep it local: avoid upload-based viewers. Our viewer never sends the file anywhere.
- Do not pretty-print a 500 MB file just to read it; indentation can roughly double the size. Query first, format the result.
- If you control the producer, emit NDJSON or paginate the API instead of returning one giant array.
FAQ
How do I open a large JSON file?
Use a viewer that parses in a background thread and virtualizes the tree, such as the large JSON viewer, or query it from the command line with jq instead of opening it in an editor.
Why does VS Code freeze on big JSON files?
Editors tokenize, highlight and fold the whole file, and minified JSON is often one enormous line. VS Code disables some features for large files, but very large single-line files remain slow. Use a dedicated viewer or jq.
What is the maximum JSON file size a browser can handle?
There is no fixed limit; it depends on available memory and the browser's per-tab limits. Parsing in a worker and rendering only visible rows lets browsers handle files in the hundreds of megabytes on typical laptops.
How do I read a JSON file that does not fit in memory?
Use a streaming parser: jq --stream, Python ijson, or a streaming library in your language. Each processes one record at a time.
How do I split a big JSON array into smaller files?
Convert it to NDJSON with jq -c '.[]' (or the streaming variant), then use split -l N to cut it into chunks of N records.

