JSON Lines (JSONL / NDJSON): what it is and how to use it

JSON Lines puts one JSON object per line, making it streamable and appendable where a single JSON array isn't. Here's what JSONL/NDJSON is, when to reach for it, and how to open it.

JSON Lines — also called JSONL or NDJSON (newline-delimited JSON) — is a text format that stores one JSON value per line. There is no enclosing array and no commas between records; each line is an independent, complete JSON document terminated by a newline. That single design choice is what makes it streamable and appendable where an ordinary JSON array isn't.

A JSON Lines file looks like this:

{"id": 1, "event": "login", "ok": true}
{"id": 2, "event": "purchase", "amount": 19.99}
{"id": 3, "event": "logout", "ok": true}

The same data as a regular JSON document would be a single array wrapping all three objects with commas between them.

JSON Lines (JSONL)JSON array
StructureOne value per lineOne array of values
ParseLine by line (streaming)All at once
Append a recordAdd a line — no rewriteRewrite the whole file
One bad recordSkip that line, keep the restWhole file fails to parse
Best forLogs, exports, streamsSelf-contained documents
  • Logs and events — append one line per event without ever rewriting the file.
  • Large data exports — databases and data tools (BigQuery, MongoDB, pandas) export JSONL so a consumer can process records without loading everything into memory.
  • Streaming APIs — a server can flush one record at a time, and the client can start work on line 1 before the response finishes.
  • Fault tolerance — a single malformed record only loses that line, not the entire dataset.

Prefer a plain JSON array when you need a single self-contained document — a config file, an API response with a fixed shape, or anything a human will read top to bottom.

  1. Drop a .jsonl or .ndjson file onto the editor (or paste the lines and pick JSON Lines from the format selector).
  2. Each line is parsed into a record. Switch to the tree or table view to browse the records.
  3. Use Convert to… to turn the records into a single JSON array, a CSV, or YAML — see cross-format conversion.

Everything is decoded in your browser; the file is never uploaded.

What is the difference between JSONL and JSON?

A JSON file is one value — usually a single array or object — that must be parsed all at once. A JSON Lines (JSONL) file is many independent JSON values, one per line, with no enclosing array and no commas between them. JSONL can be read, appended, and streamed one record at a time; a JSON array cannot.

Are JSONL and NDJSON the same thing?

Effectively yes. JSON Lines (.jsonl), NDJSON (newline-delimited JSON), and the LDJSON variant all describe the same format: one valid JSON value per line, separated by a newline (\n). The names are used interchangeably; tooling that reads one reads the others.

When should I use JSON Lines instead of a JSON array?

Use JSONL for logs, data exports, streaming APIs, and large datasets you process record by record. Because each line stands alone, you can append a new record without rewriting the file, and a consumer can start processing line 1 before the file finishes downloading. Use a plain JSON array when you need a single self-contained document.

How do I view or convert a JSONL file?

Drop a .jsonl or .ndjson file onto Yellorn, or paste the lines in. It parses each line and shows the records as a tree or table in your browser. From there you can convert the data to a JSON array, CSV, or YAML in one click — nothing is uploaded.

Try a fix in the editor or browse more articles.