NDJSON / JSONL Converter
Convert between NDJSON / JSONL and JSON arrays in both directions: one JSON value per line, blank lines skipped, and parse errors reported with the exact line number.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
NDJSON→array: one JSON value per line, blank lines are skipped and errors name the exact line. Array→NDJSON: paste a JSON array and get one compact JSON value per line.
Converted output
The array direction supports indentation; the NDJSON direction always emits one compact JSON value per line, since the newline is the separator.
Enter a value to see the converted output
What this tool does
- Turn NDJSON / JSONL logs or crawler output into a JSON array for further processing
- Split a large array into one-JSON-per-line JSONL for streaming imports or LLM training scripts
Example
Input
{"id":1}
{"id":2}Output
[
{
"id": 1
},
{
"id": 2
}
]One JSON value per line, merged into a single array.
Frequently asked questions
What if a line contains several JSON values?
You get "Line N is not valid JSON". NDJSON requires exactly one complete JSON value per line, so multi-line arrays or objects are rejected.
How are blank lines and trailing spaces handled?
Each line is trimmed and blank lines are skipped, so trailing spaces, \r\n endings and a trailing newline are harmless. Reported line numbers still count the original lines, including blanks.
Is the array-to-NDJSON output indented?
No. In JSONL the newline is the record separator, so every element is emitted as compact JSON. The indent toggle only affects the array direction.
Is BOM or comments supported?
No. A BOM, // comments and trailing commas all make the line fail to parse, and the line number is reported.
Keywords:ndjson to jsonjsonl to json