Paste or upload a .jsonl file and click Parse & View.
JSONL Viewer Online
View and validate JSONL (JSON Lines / NDJSON) files directly in your browser. Each line is parsed and displayed individually: click any line to expand it into pretty-printed JSON. A stats panel shows valid counts, invalid lines with specific errors, and all keys found across the dataset.
Why you need a dedicated JSONL viewer
Standard JSON editors and formatters expect a single document. Open a 500-line JSONL file in a JSON formatter and it will either reject the file (because multiple top-level values are not valid JSON) or treat the entire file as a string. A proper JSONL viewer parses each line independently, exactly the way a production JSONL consumer would: and reports problems at the line level rather than flagging the entire file as invalid.
This matters when debugging real data. An ML dataset with 10,000 training examples and 3 malformed lines will silently fail in some pipelines and loudly crash in others. Identifying which lines are broken: and why: saves hours of debugging. The Invalid filter isolates every broken line and shows the exact parse error for each one.
What Is JSONL?
JSONL (JSON Lines) is a text file format where every line is a complete, valid JSON value: typically an object. Each line is independent: parseable on its own, without needing to load the entire file. A JSONL file can be read record-by-record using a simple loop, appended to by writing a new line, and processed in parallel by splitting the file. Compare this to a standard JSON array, which must be fully parsed before any record is accessible.
Files use extensions .jsonl, .ndjson, or sometimes .json. The IANA media type is application/x-ndjson. Despite the different names, all three describe the exact same format.
How to use
- Paste JSONL text or click Upload .jsonl to open a local file.
- Click Parse & View to parse all lines.
- Read the stats panel: valid count, invalid count, all top-level keys found.
- Use the Invalid filter to isolate lines with parse errors.
- Click any line to expand it into formatted, indented JSON for easy reading.
- Use Expand all to open every line at once for a full data scan.
Viewer features
- Per-line validation with specific error message for each invalid line
- Stats panel: total lines, valid count, invalid count, key union
- Filter controls: show All / Valid only / Invalid only
- Expand / collapse any line to pretty-printed JSON with 2-space indent
- Expand all / Collapse all for bulk exploration
- File upload for .jsonl and .ndjson files
- Browser-only: no upload, no server, no data leaving your device
Where JSONL files come from
Common reasons JSONL lines fail validation
When the Invalid filter shows lines, these are the most common root causes:
- Trailing comma:
{"a":1,"b":2,}: valid in JSON5/JavaScript but not JSON - Single-quoted strings:
{"name":'Alice'}: must use double quotes - Embedded newline in a string: JSON strings cannot span multiple lines; use
\ninstead - Non-JSON lines: a CSV header, log prefix, or separator line mixed into the file
- Truncated line: a line that starts with
{but was cut off mid-write, leaving an unclosed object - BOM character: a UTF-8 BOM at the start of the first line (
0xEFBBBF) that JSON.parse rejects
Privacy
All parsing and viewing runs in your browser. JSONL files from data pipelines often contain production records, user data, model training examples, or internal event logs. Nothing you open here is sent to any server: use DevTools → Network to verify zero outbound requests.
Frequently asked questions
What is JSONL and how is it different from a JSON array?
JSONL is one independent JSON value per line. A JSON array wraps all records in a single [ ] document that must be fully parsed before any record is accessible. JSONL is streaming-friendly: you can read, append, and process records one line at a time. A JSON array must be loaded in full.
Why does the viewer show some lines as invalid even though my file works in the pipeline?
Some JSONL consumers are lenient: they skip blank lines, handle BOM characters, or accept trailing commas via a custom parser. This viewer uses strict JSON.parse. If your pipeline accepts the file but this viewer flags lines, your pipeline is applying leniency. The invalid lines may cause subtle data loss if the pipeline silently skips them.
What does the key union show?
Key union is the set of all top-level keys found across every valid line. It helps you see the schema at a glance: which fields exist, which are optional (appear in some records but not all), and whether key names are inconsistent (e.g. userId vs user_id in different lines).
Can the viewer handle .ndjson files?
Yes. JSONL and NDJSON are the same format with different names. Upload a .ndjson file and it works identically.
What is the maximum file size I can view?
There is no hard limit: it depends on your browser's memory. Files with tens of thousands of lines work in seconds. For very large files (millions of lines, hundreds of MB), the browser may run slow; in that case use a command-line tool like jq or python -c "import sys, json; [json.loads(l) for l in sys.stdin]".
How do I fix invalid lines after finding them?
Use the Invalid filter to see each broken line and its specific error. Common fixes: remove trailing commas, replace single quotes with double quotes, escape embedded newlines as \n, or remove non-JSON prefix/header lines. For systematic fixes across many lines, write a Python or Node.js script.
Can I convert the viewed JSONL to a JSON array?
Yes. Use the JSONL to JSON converter (/jsonl-to-json). It wraps all valid lines into a standard JSON array. To go the other direction, the JSON to JSONL converter (/json-to-jsonl) converts a JSON array back to JSONL.
Related tools