Docs / Formats
JSONL and NDJSON
Last updated:
JSON Lines (JSONL, also called NDJSON) stores one JSON value per line. Log files, data exports, and streaming APIs use it. Prettify detects JSONL, shows it as JSON, and writes it back line by line. This page explains that behavior and its limits.
Open the editor at /app/editor.
How Prettify detects JSONL
Prettify checks for JSONL after it rules out a single JSON document. The text must have two or more non-blank lines, and the first lines must each parse as JSON on their own. A pretty-printed object that spans several lines is one document, so it stays JSON.
A .jsonl or .ndjson file also opens as JSONL. JSONL is detected automatically. It is not offered in the format pickers; Prettify presents it as JSON with a JSON Lines badge.
{"id": 1, "event": "login"}
{"id": 2, "event": "logout"}
{"id": 3, "event": "login"}
Views
JSONL parses into an array of the line values, so the structured views work. Tree, Raw, and Table are free. Diagram (Pro) draws the data as a node graph.
Table view is the common choice, because each line becomes one row. See Views and Table view.
How it round-trips
Prettify writes JSONL back as one compact JSON value per line, not as a JSON array. The numbers stay exact, the same way they do for JSON: bigints and Snowflake IDs survive parse, view, and serialize byte for byte.
A blank line and a trailing newline are skipped.
Bad lines do not fail the document
One bad line does not stop the rest. Each good line still parses. Each bad line is kept in place as raw text and reported as a problem in the Problems panel.
This matters for a round trip. An edit, sort, copy, or download re-emits a bad line exactly as it was, so Prettify never drops your data. The document is invalid only when every non-blank line fails to parse.
Convert and query
Convert turns JSONL into JSON, YAML, CSV, or XML; the lines behave like a JSON array. Converting JSON to JSONL writes each array element on its own line. A non-array document becomes a single-element array when it reloads as JSONL, and Prettify warns you. See Conversion.
When you convert JSONL that still holds a bad line, the bad line is written as raw text, and every target except JSONL gets a warning.
jq (Pro) filters JSONL as it does JSON. See jq queries. Diff / Compare (Pro) is at Diff.
Related pages
- JSON for the full number, comment, and repair behavior.
- Conversion for turning JSONL into other formats.
- Privacy for what stays on your device.
Try it online
Tool pages for this topic. Each one runs in your browser.