JSON Lines to JSON Array Converter
Converts newline-delimited JSON into a single array, and back again.
Loading the tool…
Processing happens locally in your browser.
What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.
How to use this tool
- Paste JSON Lines, one complete JSON value per line, or a JSON array.
- Select Lines to array, or Array to lines for the reverse direction.
- Any line that fails to parse is listed with its line number rather than dropped.
What jsonl to json does
JSON Lines stores one complete JSON value per line. It is the natural format for streaming and for append-only logs, because a process can write a record without rewriting the file and a reader can process one record at a time without holding the whole file in memory.
Most tools that expect JSON, though, expect a single array. Converting between the two is a one-line operation conceptually and a nuisance in practice, because a malformed line halfway through a large file needs to be reported rather than silently skipped. Bad lines are listed here with their line number.
Frequently asked questions
A format where each line is one complete, self-contained JSON value. It suits streaming and append-only logs because a writer can add a record without rewriting the file and a reader can process one record at a time.
It is reported with its line number and the parser error, and the remaining lines are still converted. Bad records are surfaced rather than silently dropped.
For practical purposes yes. NDJSON and JSON Lines both mean one JSON value per newline-delimited line, and this converter reads either.