Newline-delimited JSON
Newline-delimited JSON stores or transmits a sequence of UTF-8 JSON values separated by line endings.
NDJSON: Version 1.0.0 requires LF after each value, optionally preceded by CR, and prohibits literal CR/LF inside a JSON text. Parsers accept LF and CRLF; ignoring empty lines must be documented and should be configurable. [1]
JSON Lines: This closely related convention allows any JSON value on a line, rejects blank lines and recommends rather than requires a final line terminator. Do not assume identical edge-case contracts. [2]
Scope: Neither convention requires object-only records. Escaped newline sequences inside strings do not create physical record boundaries. [1] [2]
Relations
- related
- Data serialization, JSON text sequence
Citations
- NDJSON specification 1.0.0, serialization and parsing, sections 3.1-3.3
- JSON Lines: UTF-8, JSON values and line terminators
Sources & caveats
- Specification synthesis, not a parser conformance study or a crash-recovery experiment.