JSON Tools
JSONL Viewer — JSON Lines & NDJSON, One Record per Line
The JSON Viewer can't open a .jsonl file at all — JSON.parse fails on line two. This page reads it the way it's actually structured: one JSON value per line.
In short
View JSON Lines online: parse .jsonl / NDJSON logs line by line with per-line errors, browse records as a tree, and convert JSONL to a JSON array or back. Free.
By NaveenKumar T · Updated
Learn: JSON Crack Alternative Without Signup: Viewing JSON as a Tree
- Per-line parse with exact line numbers
- Records as a collapsible tree
- Skip-or-stop on a bad line, your choice
Runs entirely in your browser — nothing you paste or open here is uploaded, logged, or stored.How we handle data →
Example
JSONL Viewer: input and output
Four structured log lines — each with a timestamp, a level, a message and a nested context object — the shape a real logging pipeline produces.
{"ts":"2026-09-18T09:30:00Z","level":"info","msg":"request received","ctx":{"path":"/api/orders","method":"GET"}}
{"ts":"2026-09-18T09:30:01Z","level":"info","msg":"order lookup","ctx":{"orderId":"ORD-10428"}}
{"ts":"2026-09-18T09:30:02Z","level":"error","msg":"payment gateway timeout","ctx":{"orderId":"ORD-10428","retry":1}}
{"ts":"2026-09-18T09:30:03Z","level":"info","msg":"request completed","ctx":{"status":200}}[
{
"ts": "2026-09-18T09:30:00Z",
"level": "info",
"msg": "request received",
"ctx": {
"path": "/api/orders",
"method": "GET"
}
},
{
"ts": "2026-09-18T09:30:01Z",
"level": "info",
"msg": "order lookup",
"ctx": {
"orderId": "ORD-10428"
}
},
{
"ts": "2026-09-18T09:30:02Z",
"level": "error",
"msg": "payment gateway timeout",
"ctx": {
"orderId": "ORD-10428",
"retry": 1
}
},
{
"ts": "2026-09-18T09:30:03Z",
"level": "info",
"msg": "request completed",
"ctx": {
"status": 200
}
}
]The four independent lines became a single four-element JSON array, each record's nested ctx object intact — exactly what a plain JSON.parse on the whole file (rather than line by line) would have failed to produce, since the raw file is not itself one valid JSON document.
Learn more
JSON Lines in one paragraph
A JSON Lines document is a sequence of JSON text values, one per line, each terminated by a single \n (the spec also tolerates a trailing \r before it, so Windows-style CRLF files work too), with no top-level array wrapping the whole thing and no trailing comma between lines — because there IS no "between lines" relationship the format defines beyond the ordering. That absence of an enclosing structure is the entire point: it's what lets a producer APPEND a new record to the end of a growing file with a single write and no need to rewrite anything that came before it, which a JSON array (needing its closing ]) can't do without a rewrite.
That's also exactly why streaming and log-style tools reach for it: a process can write one line the moment an event happens, a reader can start consuming from line 1 before the writer has finished, and a partially-written file (the writer crashed mid-record) still has every COMPLETE line before the break intact and readable, unlike a JSON array truncated mid-document, which is unparseable as a whole from the first byte.
Reading logs and datasets line by line
The shapes that land on this page most often: structured application logs (one JSON object per log event, often with level, msg, ts and a nested ctx or fields object), dataset exports for machine learning fine-tuning (OpenAI's JSONL fine-tuning format, Hugging Face dataset exports), analytics and warehouse exports (BigQuery and BigTable both support newline-delimited JSON as an export/import format directly), and session or transcript exports from chat and agent tools, where each line is one turn or one event in a conversation.
kubectl logs and similar container log streams are sometimes JSON-per-line too, when the application inside the container uses a structured logger — pasting a captured chunk of that output here parses it the same way, with a bad or truncated final line (common when a capture is cut off mid-write) handled by the Invalid lines option instead of failing the whole paste.
| JSON Lines (.jsonl) | JSON array | |
|---|---|---|
| Append a new record | Write one more line — no rewrite needed | Must reopen and rewrite the closing ] |
| Partial-write safety | Every complete line before a crash is readable | A truncated file is unparseable as a whole |
| Streaming reads | Natural — read and parse one line at a time | Needs the whole document (or a streaming JSON parser) |
| Tooling support | jq -c, BigQuery, mongoimport, most log pipelines | Universal — every JSON parser |
Producing JSONL from the command line
If the file on this page came from a JSON array you need to flatten yourself, or you're producing one to feed into this page's View mode, these are the standard one-liners for the job — the same transformation this page's "Convert to JSONL" mode performs on a pasted array.
| Tool | Command |
|---|---|
| jq | jq -c '.[]' file.json > file.jsonl |
| Python | import json; [print(json.dumps(r)) for r in json.load(open('file.json'))] |
| PowerShell | $data | ForEach-Object { $_ | ConvertTo-Json -Compress } |
Help
Frequently asked questions
Everything you need to know about the JSONL Viewer.
01What is JSON Lines / NDJSON and why won't a normal JSON viewer open it?
JSON Lines (also called NDJSON, Newline-Delimited JSON) is a text format where each line is a complete, independent JSON value — usually an object — with no enclosing array, no commas between lines, and nothing tying them together except the newline. That's precisely what makes a normal JSON viewer choke on it: JSON.parse expects ONE value for the whole input, and the moment it hits the newline after the first line's closing brace and sees a second, unrelated { starting right after, it throws a syntax error — the file was never meant to be parsed as one document. This page parses it the way it's actually structured: one JSON.parse call per line, independently, so line 4 being malformed never stops lines 1 through 3 (or 5 onward) from being read.
02How do I convert a JSON array to JSONL (and back)?
Switch Mode to "Convert to JSONL" and paste a JSON array — each element becomes its own compact line with no surrounding brackets or commas, exactly the shape mongoimport, BigQuery batch loads and jq -c expect. Going the other way is the default View mode: paste (or drop) a .jsonl/.ndjson file and it's parsed straight into a JSON array in the output pane, ready to copy, download, or explore as a tree.
03What happens to a line that isn't valid JSON?
You choose, via the Invalid lines option. "Stop on first error" (the default) fails immediately and reports the exact line number and parse error, the same as any strict parser would — useful when you need to know a file is genuinely broken before trusting it. "Skip bad lines" instead parses everything it can, drops the lines that don't parse, and reports exactly which line numbers were skipped in the status message, which is the more forgiving choice for a large log export where one truncated line at the end shouldn't block reading the other 50,000.
04Can I open exported chat/session .jsonl files or app logs?
Yes — that's the common case this page is built for. Structured logging frameworks (pino, structlog, Google Cloud's Logging export), chat/agent session exports and fine-tuning datasets (OpenAI's own JSONL fine-tuning format among them) all use one JSON object per line, often with deeply nested fields like a message or ctx object inside each record. The tree view handles that nesting the same way the JSON Viewer does, per record. One honest limit: this page reads everything you paste or drop into memory as text — very large exports (hundreds of megabytes) are better split first, since there's no streaming/tail mode here the way a dedicated log viewer would offer.
05Is .ndjson the same as .jsonl?
Functionally, yes — both names describe the identical convention of one JSON value per line separated by \n, encoded as UTF-8. ".jsonl" and ".ndjson" are simply two file-extension conventions that grew up around the same idea (jsonlines.org documents the format under the .jsonl name; ndjson.org documents essentially the same rules under its own name and the media type application/x-ndjson). This page accepts either without needing to know which name your source used.
Keep working
Related tools
JSON Viewer
JSON Tools
CSV to JSON
Header-aware CSV parsing into clean JSON — pick the delimiter, keep IDs as strings or type them, and choose objects, arrays or JSON Lines.
JSON to CSV
Flatten JSON arrays into spreadsheet-ready CSV — nested keys become dot-path columns, quoting handled for you.
JSON Formatter
JSON Tools
JSONPath Tester
JSON Tools
JSON Builder
JSON Tools
Learn the format
Related guides
JSON Crack Alternative Without Signup: Viewing JSON as a Tree
JSON Crack draws JSON as a node graph. If you want a collapsible tree with path queries instead, here is how the two compare — checked September 2026.
5 min readGuide · JSONHow to Open a JSON File (and Actually Read It)
Three ways to open a .json file: instantly in your browser, in a proper editor, or in Excel/Sheets — plus why double-clicking shows you a wall of text.
2 min read