NDJSON to JSON Converter
Combine a newline-delimited JSON file into one array you can format, browse or query — and find out exactly which line is malformed when one of them is.
Input
NDJSON- characters
- 0
- lines
- 0
- size
- 0 B
Options
About this tool
Log exports, database dumps and inference outputs all tend to arrive as NDJSON, because writing one record per line is the cheapest thing a producer can do. Reading them is another matter: most JSON tooling expects a single document, so the first step is nearly always to combine the lines into an array.
The useful part is what happens when it goes wrong. In a 50,000-line export, one truncated record is entirely normal, and the only thing that matters is which line it is. Errors here carry the line number from the source file, so it matches what your editor shows.
Blank lines are skipped rather than treated as errors, and reported in the warnings so a file full of them does not pass unremarked.
How to use this tool
Paste NDJSON, or upload a .ndjson, .jsonl or .log file.
Choose the indentation for the resulting array.
Press Convert.
If a line fails, use the reported line number to find it in the source.
Key features
- Every line parsed as an independent JSON value
- Errors reported with the line number from the source file
- The offending line shown as an excerpt alongside the error
- Blank lines skipped and counted rather than treated as failures
- Tolerant of CRLF line endings on input
- Record count reported so you can check nothing was lost
Example
Input — NDJSON
{"id":101,"name":"Ha-eun"}
{"id":102,"name":"Marco"}Output — JSON
[
{
"id": 101,
"name": "Ha-eun"
},
{
"id": 102,
"name": "Marco"
}
]Good to know
- The whole file is held in memory, so this is not a streaming reader. Very large exports should be split before converting.
- Conversion stops at the first malformed line rather than skipping it — silently dropping a record from a dataset would be worse than failing.
- Records are combined in the order they appear; the tool does not sort or deduplicate them.
Frequently asked questions
What if one line in a large file is broken?
Conversion stops and the error names the source line number, with an excerpt of the line. Nothing is silently dropped, because a missing record in a dataset is a much more expensive problem than a failed conversion.
Does it handle .jsonl files?
Yes. NDJSON and JSON Lines describe the same layout, and .jsonl, .ndjson and plain .log exports all work.
Are blank lines a problem?
No. They are skipped, and the number skipped is reported as a warning so an unusually large count does not go unnoticed.
My file has Windows line endings. Will it work?
Yes. Carriage returns are handled on input even though the reverse converter only ever writes line feeds.
Further reading
What is NDJSON? — NDJSON is JSON with one complete value on each line and no array around it. That one change is what makes a file streamable — and what breaks it if you pretty-print it.
Your data stays on your device
Your data is processed locally in your browser and is not uploaded to our server. This page keeps working after you go offline, because there is nothing to send.
Related tools
- JSON to NDJSONConvertersSplit a JSON array into one record per line for streaming and bulk loads.JSONNDJSON
- JSON FormatterJSON ToolsPretty-print messy JSON with your choice of indentation and optional key sorting.JSONJSON
- JSON ViewerJSON ToolsBrowse JSON as a collapsible tree, search keys and values, and copy JSONPath.JSONTree
- JSON to CSVConvertersFlatten an array of JSON objects into a spreadsheet-ready CSV file.JSONCSV
- JSON ValidatorJSON ToolsCheck JSON syntax and get the exact line, column and cause of every failure.JSONReport