About this tool
Convert newline-delimited JSON (NDJSON/JSON Lines) to a JSON array and back, with per-line error reporting.
This converter transforms NDJSON — newline-delimited JSON, also known as JSON Lines — into a single JSON array, and unwraps a JSON array back into one minified record per line. It applies the format's core rule that every line must be one complete RFC 8259 JSON value, reports the exact line number of any malformed record, and handles CRLF endings and blank lines. It is built for developers wrangling log exports, Elasticsearch bulk files, BigQuery exports and streaming API output.
Open NDJSON to JSON Converter on AltFTool — it loads instantly in your browser.
Paste or upload your source content.
Choose the target format or conversion mode.
Copy or download the converted result.
NDJSON to JSON array and JSON array back to NDJSON, with a shared record count.
A malformed record fails with its line number instead of a vague whole-file error.
Written NDJSON is minified one value per line, because the format forbids literal newlines inside a value.
A JSON file is one single value, while NDJSON is a stream of many JSON values separated by newlines — one complete value per line. That structure lets tools process records line by line without loading the whole file, which is why log pipelines, jq, BigQuery and Elasticsearch bulk APIs use it.
Because NDJSON requires each line to be a complete JSON value, and pretty-printing spreads one value across many lines. Convert the array with this tool instead: each element is re-serialised minified onto its own line, which is the only layout the format allows.
jq -s '.' file.ndjson slurps every line into one array, which is exactly the transformation this tool performs in the browser — with the addition that a broken line is reported by number rather than failing the whole slurp.
Strictly a value per line is expected, but real-world files end with a trailing newline and Windows tools write CRLF, so this converter strips the \r before parsing and skips blank lines while counting them. Anything else on a line must parse as JSON or the conversion stops with that line number.
Add the NDJSON to JSON Converterwidget to your blog or website — free, responsive, no signup. Just keep the “Widget by AltFTool” credit link visible.
<iframe src="https://www.altftool.com/embed/widget/ndjson-to-json-converter"
title="NDJSON to JSON Converter — free AltFTool widget"
width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden"
loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
<p style="font-size:12px;margin:4px 0 0">Widget by <a href="https://www.altftool.com/tools/all/ndjson-to-json-converter?utm_source=embed&utm_medium=widget">AltFTool — free online tools</a></p>