Skip to content
Json Works

How to View Large JSON Files

Updated

A 200 KB JSON file opens anywhere. A 50 MB file makes some editors hang, and a 2 GB file can crash almost everything. If you have ever watched a spinner while your text editor tried to syntax-highlight a single 40 MB line, this guide is for you.

Why large JSON is hard

Three things work against you:

  1. One giant line. Minified API responses have no line breaks. Editors are built around lines, and a single line of millions of characters defeats rendering, wrapping and highlighting.
  2. Tree views build every node. Collapsible tree viewers create a UI element for every object and value. Half a million nodes is far more than a browser can comfortably lay out.
  3. Parsing needs memory. A parser turns text into in-memory objects, which are often 3 to 10 times larger than the file. A 100 MB file can need hundreds of megabytes of RAM.

The solution is to avoid doing all of that at once: show a slice, virtualise the display, or stream.

Method 1: Use a table with virtual scrolling

If your JSON is an array of records, which is the usual reason it is big, a table is the best way to look at it. A table only draws the rows visible on screen, so a million records scroll as smoothly as ten.

  1. Open JSON to Table and drop the file onto the input. Dropping a file is better than pasting, because it avoids moving the text through the clipboard and the text box.
  2. Wait for the table to build. Tens of megabytes and hundreds of thousands of rows work on a typical laptop.
  3. Use the search box to filter, click headers to sort, and hide columns you don’t need.

Everything happens locally, so there is no upload wait and no size limit imposed by a server. The practical limit is your browser’s memory.

Method 2: Use a formatter to see the shape

Sometimes you do not need all the data, just the structure. Paste a representative chunk into the JSON Formatter to pretty-print it and learn the field names. Then take only what you need.

If the file is too big to paste, cut a sample from the start:

head -c 20000 big.json

The cut will not be valid JSON, but you can read the field names. For a proper sample of an array, use jq:

jq '.[0:5]' big.json > sample.json

Method 3: Query instead of scrolling

If you know what you are looking for, pull it out directly. JSONPath expressions such as $.data[?(@.status=='failed')].id return only matching values. With jq on the command line:

# all emails
jq -r '.users[].email' big.json

# count records
jq 'length' big.json

# records where age > 50
jq '[.[] | select(.age > 50)]' big.json

jq loads the entire file, so it is fine for hundreds of megabytes but struggles at several gigabytes.

Method 4: Stream huge files

For files measured in gigabytes, use a streaming approach that never holds the whole document in memory.

  • jq with --stream emits path/value pairs as it reads:

    jq --stream -c 'select(length==2)' huge.json | head
  • JSON Lines. If you control the export, write one object per line (NDJSON). Then standard tools work: head, grep, wc -l, split. Each line is independently valid JSON.

    head -n 5 huge.ndjson
    grep '"status":"failed"' huge.ndjson | wc -l
  • DuckDB reads JSON directly and lets you query it with SQL:

    SELECT status, count(*) FROM read_json_auto('huge.json') GROUP BY status;
  • Split first, then open the pieces:

    jq -c '.[]' big.json | split -l 100000 - part_

Method 5: Pick the right editor

If you need a text view, choose tools that handle size well:

  • VS Code struggles with files over about 50 MB and with extremely long lines. Disable word wrap and minimap for large files, or use the “Large file” setting.
  • Sublime Text, Vim, or less handle big files better because they load lazily. less is usually the safest.
  • Pretty-print before opening so lines are short: jq . big.json > pretty.json. The file gets larger but becomes editor-friendly.

Tips for working with big files

  • Look at the first record first. It shows the schema. Then check a middle and a last record, since shape often changes.
  • Check for an envelope. The records might be under data, items or results. The table tool finds the largest array automatically, or you can pick it with Table rows from.
  • Remove what you don’t need early. Dropping unused columns makes later steps faster and exports smaller.
  • Mind export limits. Excel allows 1,048,575 data rows per sheet. If you have more, export CSV or split the data.
  • Keep the original. Work on copies, especially if you are cleaning data.

Privacy with big files

Large exports often contain the most sensitive data: full customer tables, logs, database dumps. Avoid online viewers that upload your file to a server. A client-side tool such as Json Works parses the file in your browser, and you can confirm nothing is sent by looking at the network tab.

Next steps

Once you can see the data, you can flatten it, export it to Excel, or compare two versions. If the file will not load at all, it may be invalid; check the common JSON errors.

More guides

All guides · FAQ