JSON to JSON Lines
Input
[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}]Output
{"id":1,"name":"Alice"}
{"id":2,"name":"Bob"}The array brackets and separating comma are gone; each record stands alone on its line.
JSON Lines (also called NDJSON) stores one complete JSON value per line. The point is streaming: a consumer can process each line as it arrives rather than waiting for a closing bracket, and a single corrupt record does not invalidate the whole file.
It is the standard format for log shipping, BigQuery and Athena imports, Elasticsearch bulk loads, and machine-learning datasets, anywhere records are appended continuously or processed line by line.
Each example below is executed against this tool by the test suite, so what you see is what the tool actually produces.
Input
[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}]Output
{"id":1,"name":"Alice"}
{"id":2,"name":"Bob"}The array brackets and separating comma are gone; each record stands alone on its line.
The details that decide whether a conversion is correct, and where information can be lost without any error being raised.
Wrap newline-delimited records into a JSON array.
Indent and beautify JSON, with syntax error locations when available.
Remove all unnecessary whitespace from JSON and measure the saving.
Turn JSON records into a spreadsheet-ready CSV table.