How to Open Large JSON Files (100 MB and Bigger)
You download an API export, a log dump or a database backup, double-click the .json file, and your editor freezes. Or the browser tab crashes. Large JSON files are surprisingly hard to open, even on a fast computer. This guide explains why, and shows five approaches that actually work, from a quick online viewer to command-line tools for files of many gigabytes.
Why large JSON files are hard to open
There are three separate problems, and most tools only solve one of them:
- Parsing needs a lot of memory. A JSON file is text. To work with it, a program turns it into objects in memory, and those objects take far more space than the text: often 3 to 10 times the file size. A 300 MB file can need 1โ3 GB of RAM.
- Drawing everything is slow. Many viewers create one on-screen element per value. A file with 5 million values means 5 million elements, and the browser or editor grinds to a halt long before it finishes.
- Text editors are not built for one giant line. Minified JSON is often a single line that is hundreds of megabytes long. Syntax highlighting, word wrap and line measurement all struggle with that.
Method 1: Use a viewer built for big files (easiest)
The JsonStage JSON Viewer was designed for exactly this problem. It parses the file in a background thread (a Web Worker), so the page never freezes, and it only draws the rows you can actually see. In our tests a 150 MB file with 11 million values opens in about 3 seconds, and a 400 MB file with almost 30 million values in about 7 seconds.
- Open the viewer and drag your file onto the page (or click Open file).
- Browse the tree: click to expand, or use the arrow keys.
- Use the search box to find a key or value anywhere in the file, then copy its path, for example
$.orders[1532].customer.email.
The file is processed entirely in your browser. Nothing is uploaded, which matters when the file contains customer data or internal logs.
Method 2: VS Code (for files up to roughly 50 MB)
VS Code opens medium-sized JSON files well. For larger files it switches into a reduced mode and turns off features such as syntax highlighting and folding to stay responsive. If the file is a single minified line, format it first (see how to pretty print JSON) so that it has normal lines. Above a few hundred megabytes, most desktop editors become impractical.
Method 3: jq on the command line
jq is a fast command-line JSON processor. It is ideal when you only need part of a big file.
# Pretty print and page through the file
jq . big.json | less
# Show only the top-level keys
jq 'keys' big.json
# How many items are in the top-level array?
jq 'length' big.json
# Extract one field from every item into a new file
jq '[.[] | {id, email}]' big.json > small.jsonFor files too big for memory, jq has a streaming mode (--stream) that reads the file piece by piece. It is harder to use, but it can process files of many gigabytes.
Method 4: Python with streaming
Python's built-in json.load() reads the whole file into memory. For huge files, the ijson library reads items one at a time:
import ijson
with open("big.json", "rb") as f:
# "item" means: each element of the top-level array
for order in ijson.items(f, "item"):
if order["total"] > 1000:
print(order["id"])Memory use stays small no matter how large the file is, because only one item is in memory at a time.
Method 5: Split the file
If the file is a big array, you can split it into smaller files and open them one by one. With jq, this writes one item per line (the JSON Lines format), which most tools handle well:
jq -c '.[]' big.json > items.jsonl
split -l 100000 items.jsonl part_Which method should you use?
| Situation | Best choice |
|---|---|
| Look around, search, copy a path or value | Online viewer (no install, private) |
| Edit a medium-sized file | VS Code after formatting |
| Extract or filter part of the data | jq |
| Process a multi-gigabyte file in a script | Python ijson or jq --stream |
FAQ
What is the largest JSON file a browser can open?
It depends mostly on available memory. With an efficient viewer, a few hundred megabytes is realistic on a typical computer. Beyond about 500 MB, command-line or streaming tools are more reliable.
Why does my file open but show an error?
Large exports are sometimes cut off before the end, which leaves the JSON incomplete. See Unexpected token in JSON for how to find the exact position of the problem, or try JSON Repair to close missing brackets.