JSONL to JSON Converter (NDJSON)
Parse one JSON object per line and collect the records into a standard JSON array.
Parse one JSON object per line and collect the records into a standard JSON array.
JSON Lines, often called JSONL or NDJSON, stores one complete JSON value on each line with no enclosing brackets and no commas between records. This converter reads those records and returns a standard, pretty-printed JSON array that can be inspected, diffed, queried or passed to any tool that expects ordinary JSON.
JSONL suits writing and streaming: a logger can append a line at a time and a loader can process a file without holding all of it in memory. A JSON array suits reading: browsers, viewers, test fixtures and most REST clients want a single document. Converting JSONL to JSON is the bridge between the two.
Structured loggers write one event per line. Input:
{"ts":"2026-10-01T09:00:00Z","level":"info","msg":"server started","port":8080}
{"ts":"2026-10-01T09:00:02Z","level":"error","msg":"db timeout","retry":3}Output:
[
{
"ts": "2026-10-01T09:00:00Z",
"level": "info",
"msg": "server started",
"port": 8080
},
{
"ts": "2026-10-01T09:00:02Z",
"level": "error",
"msg": "db timeout",
"retry": 3
}
]Records do not need the same keys: the second event has retry and no port, and both are kept exactly as written.
Any JSON value is allowed on a line, and the empty line is skipped:
1
"two"
[3, 4]
{"five": 5}
nullbecomes
[
1,
"two",
[
3,
4
],
{
"five": 5
},
null
]LLM batch jobs return one result per line. Converting them to an array makes it easy to scan status codes in the JSON viewer or filter them with JSONPath:
{"custom_id":"req-1","response":{"status_code":200,"body":{"id":"msg_01"}}}
{"custom_id":"req-2","response":{"status_code":429,"body":{"error":"rate_limited"}}}{, fails on that line. Put each record on one line first, for example with the JSON minifier.[ and records end in commas, it is regular JSON, not JSONL, and does not need converting. Check it with the JSON validator.{"a":1}{"a":2} is not valid JSONL. Insert a line break between the values.Keep data as JSONL when it is uploaded for fine-tuning, loaded into BigQuery, sent to the Elasticsearch bulk API or appended by a logger. Convert JSONL to JSON when you need to read it, compare two exports in the JSON diff checker, explore it with the jq playground, flatten it into a spreadsheet with JSON to CSV, or infer a contract with the JSON Schema generator. To go the other way, turn an array back into one record per line with the JSON to JSONL converter.
In practice, yes. JSON Lines (.jsonl) and newline-delimited JSON (.ndjson) both mean one complete JSON value per line, separated by a line feed. This converter accepts either, and also tolerates Windows \r\n line endings.
Usually because it is not really JSONL. A pretty-printed record that spans several lines, or a file that is already one big JSON array, cannot be read line by line. Minify each record onto its own line, or check the whole file with the JSON validator instead.
Yes. Empty and whitespace-only lines are skipped, and spaces around each record are trimmed before parsing, so a trailing newline at the end of the file does no harm.
Yes. Every line is parsed with the standard JSON parser, so any JSON value is accepted and copied into the output array as-is. Most JSONL producers write objects, but nothing here requires it.
The page holds the whole input in memory, which is fine for a few megabytes. For multi-gigabyte exports use the command line: jq -s . data.jsonl > data.json slurps every line into one array.
No. Splitting and parsing happen in your browser with JavaScript; the records never leave the page.