NDJSON / JSON Lines Guide
NDJSON (newline-delimited JSON), often called JSON Lines, stores one complete JSON value per line. It is useful for logs, event streams, exports and large datasets because records can be processed incrementally without loading one giant array.
Quick answer
NDJSON is not one JSON document containing many records. Each non-empty line is its own JSON document, so a normal whole-document JSON parser will reject multiple NDJSON lines as a single input.
Why NDJSON streams well
A producer can append one record at a time and a consumer can parse line by line. That reduces memory pressure and allows processing to begin before the full dataset is available.
NDJSON vs a JSON array
A JSON array begins with [ and separates records with commas. NDJSON has no enclosing array and uses newlines as record boundaries. Each line must independently contain valid JSON.
Validation strategy
Validate each line separately and report the line number of failures. Blank-line handling depends on the application; many pipelines ignore empty lines, but you should define that behavior explicitly.
NDJSON example
{"id":1,"event":"login"}
{"id":2,"event":"purchase"}
{"id":3,"event":"logout"}Related JSON tools and guides
Frequently asked questions
Is NDJSON valid JSON?
Each line is valid JSON, but the entire multi-line file is not one standard JSON document.
Is JSON Lines the same as NDJSON?
The names are commonly used for the same one-JSON-value-per-line pattern.
Why use NDJSON instead of a JSON array?
It is convenient for streaming, append-only logs and incremental processing of large datasets.