NDJSON to JSON Converter
Convert newline-delimited JSON (NDJSON, JSON Lines) to a JSON array and back, with every invalid line reported by its line number.
Free · No sign-up · Your inputs stay in your browser
Input
Convert JSON Lines (NDJSON) to a JSON array and back
Output
JSON array
3 records
Blank lines are skipped and a bad line is reported by number. Each line is parsed on its own, which is the point of the format: a log shipper, jq -c or a bulk API can stream it without holding the whole file.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Why logs and bulk APIs use it
A JSON array has to be read to its closing bracket before it is valid; a file of one JSON value per line can be streamed, appended to and split anywhere. That is why structured logs, the Elasticsearch and OpenSearch _bulk API, BigQuery loads and many data exports use it. The format is specified at jsonlines.org.
In a terminal
jq -s . file.ndjson slurps lines into an array, and jq -c '.[]' file.json writes an array out one element per line. Both stream through files larger than a browser tab can hold.