JSONL to JSON Array Converter

Convert JSONL (JSON Lines / NDJSON) into a JSON array and back again, with line-numbered errors.

Drop a .jsonl or .json file here, or tap to browse. Nothing is uploaded.

Output

Paste JSON Lines above to see the JSON array instantly.

No uploads. Your files stay on your device.

Free forever, no sign-up, no cookies. Buy me a coffee

How it works

JSON Lines (also called JSONL or NDJSON) stores one complete, self-contained JSON value per line, separated by \n. This converter reads that format the way the JSON Lines specification describes it: each line is parsed on its own as RFC 8259 JSON, blank lines are skipped, and any leading U+001E record separator from an RFC 7464 JSON text sequence is stripped before parsing. The parsed values are collected in order into a single JSON array, formatted with the indentation you pick.

Switch the direction and it runs the other way: a JSON array becomes one minified line per element, which is exactly what log pipelines, BigQuery, ClickHouse, DuckDB, OpenAI fine-tuning files and jq -c expect. Line endings are normalised, so CRLF input converts cleanly, and the JSONL output always ends with a trailing newline as the format recommends. Nested objects and arrays are preserved untouched in both directions, because every record round-trips through a real JSON parser.

If a line will not parse you get its line number and the reason rather than a silent half-conversion, which makes this a quick way to find the one bad record in an export. Everything runs in JavaScript on your device: no upload, no signup, no ads, so log dumps and data exports containing customer records never leave your browser.

Frequently asked questions

What is the difference between JSONL and a JSON array?

A JSON array is one single JSON document: an opening bracket, comma-separated values, a closing bracket. JSONL (JSON Lines, also called NDJSON) puts one complete JSON value on each line with no brackets or commas around them. The array is easier to read in one go, while JSONL streams and appends line by line, which is why logs, data exports and fine-tuning files use it.

How do I convert JSONL to a JSON array?

Paste your JSON Lines into the input box and the JSON array appears straight away. Each line is parsed on its own as RFC 8259 JSON, blank lines are skipped, and the values are collected into an array in the original order. Pick 2-space, 4-space, tab or minified formatting, then copy the result or download it as a .json file.

Can it convert a JSON array back into JSONL?

Yes. Switch the direction to JSON array to JSONL and every element of the array is written as one minified line ending with a newline, which is what BigQuery, ClickHouse, DuckDB and jq -c expect. Nested objects and arrays are preserved exactly, so converting JSONL to an array and back gives you the same records you started with.

Report a bug