What Is JSON Lines (NDJSON)? Format, Uses and Examples
Updated November 2026
JSON Lines (also called NDJSON, newline-delimited JSON) stores one complete JSON value per line, with no surrounding array and no commas between records.
Example
{"id": 1, "event": "login"}
{"id": 2, "event": "click"}
{"id": 3, "event": "logout"}Each line is valid JSON on its own. The file as a whole is not a single valid JSON document.
Why use it
- Streaming: read and process one record at a time without loading the whole file.
- Appending: add a record by writing a new line, with no need to rewrite a closing bracket.
- Resilience: one bad line does not invalidate the rest.
- Tooling: works with
grep,headandwc -l.
Typical uses
Log files, event streams, machine-learning datasets and database exports.
Working with it here
Each line is a single JSON object, so paste one line at a time into the JSON Formatter to read it. To turn a regular array into one line per record, minify each element with the JSON Minifier.