How to open large JSONL files

Updated November 4, 2026

To open a large JSONL file without a text editor freezing, use a tool that reads part of the file instead of all of it. The JSONL viewer does this in the browser, and we tested it on a 5 GiB file. On the command line, head, sed, jq, ripgrep and DuckDB all handle large files well.

Why editors struggle

Most editors load the whole file into memory and build structures for every line. JSONL files also tend to have very long lines, which many editors handle badly. Because each JSONL line is independent, a tool only needs to read the lines being shown.

Options compared

Goal Tool Notes
Browse, search and jump around JSONL viewer No install; the file stays on your machine
See the first records head -n 5 file.jsonl Instant on any size
Read one specific line sed -n '1000p;1001q' file.jsonl Stops reading at line 1001
Count lines wc -l file.jsonl Reads the whole file
Find text rg 'needle' file.jsonl ripgrep is very fast
Filter or reshape records jq -c 'select(.score > 5)' file.jsonl Streams line by line
Run SQL queries DuckDB read_json('file.jsonl') Good for aggregates
Break the file up JSONL splitter or split Keeps lines whole

Format a single record

Long records are hard to read on one line. Pipe one through jq:

sed -n '1000p;1001q' file.jsonl | jq .

In the viewer, click a line to see it formatted.

Compressed files

Files ending in .jsonl.gz need decompressing first. To look inside one without writing a copy to disk:

zcat file.jsonl.gz | head -n 5

See the browser benchmark for measured speed and memory use on a 5 GiB file.