Skip to content
All references

Data reference

NDJSON & JSON Lines Records

Prepare newline-delimited JSON records, distinguish escaped new lines from record separators and diagnose malformed imports.

8 of 8 entries

Structure

One complete value per line

{"id":1}
{"id":2}

Each non-empty input line must parse as one complete JSON value. Adjacent pretty-printed objects spanning multiple lines are not NDJSON records.

Structure

An array becomes separate records

[{"id":1},{"id":2}] → two NDJSON lines

Converting an array emits one line per array element, preserving order. Converting back wraps the parsed values in one array.

Strings

Escaped line breaks stay within a value

{"note":"first\nsecond"}

A backslash-n inside a JSON string represents a line break in that value. It must stay escaped so the serialized record occupies a single physical line.

Structure

No commas between records

{"id":1}
{"id":2}

Array commas and outer brackets belong to ordinary JSON arrays. Do not leave a trailing comma after each NDJSON record.

Values

Primitive records are supported

42
true
null
"message"

A JSON value can be a primitive as well as an object or array. Check whether the receiving service expects objects specifically.

Parsing

Blank lines are an explicit policy

record 1

record 2

This converter ignores blank lines. Different JSON Lines consumers may reject them; do not depend on blank records carrying meaning.

Parsing

A bad line identifies its record

{"id":1}
{"id":}

The reverse converter reports the offending non-empty record number. Fix malformed quoting, missing values or a line that was split inside a record.

Limits

A bounded converter is not a streaming pipeline

up to 5,000 records and 1 million characters

This browser workflow holds a bounded document in memory. Use a proper streaming processor for unbounded event feeds or much larger log files; quote exact large numeric identifiers.