JSON to JSON Lines
Convert a JSON array into newline-delimited JSON. Each element becomes a compact record for fixtures, data exchange or line-oriented processing.
- Write one element per line
- Keep nested values together
- Produce compact JSON records
Start with an array
The input must have square brackets around the collection. Each element, including scalar values, becomes an independent line.
Keep nested records intact
An object containing arrays remains one compact line. Newlines inside strings are escaped, so they do not split a record.
Know the parsing behavior
JavaScript JSON parsing may round integers beyond its safe range and keeps the last duplicate object key. Quote exact large identifiers.
Use line-oriented consumers
The output is useful when a consumer expects one complete JSON value per line. It is not a single JSON document without wrapping it in an array.
JSON to JSON Lines FAQs
No. An empty array produces an empty JSON Lines payload because there are no elements.
Use JSON Lines to JSON. It parses each nonblank line and collects the values into one array.