JSON to JSON Lines (NDJSON)
Convert a JSON array into JSON Lines — one compact record per line. The format used by log pipelines, BigQuery, jq and LLM training datasets.
Array to one-record-per-line
JSON Lines (also called NDJSON, newline-delimited JSON) stores each record as a complete JSON value on its own line. It streams and appends beautifully — you can read or write one record at a time without parsing the whole file — which is why log pipelines, BigQuery and Amazon Athena imports, jq workflows and LLM training datasets all use it. This tool takes a normal JSON array and emits one minified element per line.
[{ "id": 1 }, { "id": 2 }, { "id": 3 }]
{"id":1}
{"id":2}
{"id":3}Why it streams so well
A regular JSON array must be fully loaded and closed with its ] before it is valid. JSON Lines has no wrapping array, so a producer can append a line and a consumer can process it immediately — ideal for logs, event streams and huge datasets that never fit in memory. Each line here is minified, which is the conventional (and compact) form.
Reversible
Have an .ndjson or .jsonl file and need a normal array to work with? JSON Lines to JSON wraps the lines back into a pretty-printed array, reporting the exact line if any record is malformed.
Frequently asked questions
What is the difference between JSON Lines, NDJSON and JSONL?
They are the same thing under different names: one JSON value per line, no wrapping array, no commas between records. .jsonl and .ndjson are the common file extensions.
Are the lines minified?
Yes — each record is emitted as compact single-line JSON, which is the conventional NDJSON form and what tools like BigQuery expect. A record must fit on one line, so pretty-printing would break the format.
What can the array contain?
Any JSON values — objects are typical (one per record) but numbers, strings and arrays are valid lines too. Each element becomes exactly one line.
Why must the input be an array?
JSON Lines is a sequence of records, which maps to an array of elements. A single object would produce a one-line file; wrap it in an array if that is what you intend.