About NDJSON and JSON Array Converter
Logs, data exports and streaming APIs often write one JSON value per line, a format known as NDJSON or JSON Lines. Many tools want a single JSON array instead, and some want the reverse. Paste either one and convert it; the swap button changes direction.
Every line is checked on its own, so a broken record is reported by its line number instead of failing the whole file without saying where. You can stop at the first bad line or leave bad lines out and get a note listing them.
How it works
- Blank lines are skipped and each remaining line is parsed as strict JSON. A line that fails is reported with its line number and the column of the problem.
- With "One item per line", the array is built from the lines exactly as they were written, so numbers too long for JavaScript keep every digit. The indented and minified layouts rebuild each value.
- Converting an array to NDJSON writes each item compactly on its own line. Text that is already NDJSON is checked line by line and written back compactly.
- Repeated keys inside an object are valid JSON but usually a mistake, so their number is reported.
Questions
Is JSON Lines the same as NDJSON?
Yes, for practical purposes. Both put one JSON value on each line, separated by line breaks; the files usually end in .jsonl or .ndjson. This tool reads either, with Unix or Windows line breaks.
Can a value span several lines?
No. In NDJSON every value sits on one line, so a pretty-printed object split over lines is reported as invalid. Convert it from a JSON array instead.
Is there a size limit?
The input can be up to 10 MB, and each value may be nested up to 500 levels deep.
Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.