Skip to content

JSON Lines Converter

Converts between NDJSON and a JSON array, and reports the number of any line that will not parse instead of stopping.

Converts a JSON array into JSON Lines — one record per line, the format log pipelines and BigQuery want — and back again. It also reads a stream of JSON values with no separator at all, which several logging libraries emit and `JSON.parse` refuses outright.

🔒 Runs entirely in your browserjsonlndjsonconvertstream
Convert

Input

Drop a .json, .jsonl or .ndjson file

Read in this tab. Nothing is uploaded.

A JSON array, or a stream of values with no separator at all — which is what several logging libraries emit and what `JSON.parse` refuses.

Output

Preview

The first records, as a table.
tslevelmsgms
2025-08-27T09:00:00Zinfostarted12
2025-08-27T09:00:04Zwarnslow query2100
2025-08-27T09:00:09Zerrorupstream 502

The union of every record’s keys, across the first 200 records.

Records

3

In

246 byte

Out

209 byte

How to use it

  1. Choose the direction

    Array to lines when you are feeding something that streams; lines to array when you have a log file and want to work with it as one document.

  2. Drop the file in

    `.json`, `.jsonl` and `.ndjson` are all accepted — NDJSON and JSON Lines are the same format under two names.

  3. Check the lines that did not parse

    A bad line does not stop the conversion. It is listed by number with the text that failed, which is usually a truncated record at the end of a rotated log.

  4. Use the preview to see the shape

    The table shows the union of every record’s keys across the first two hundred records, which is the quickest way to notice that half your log lines have a field the others do not.

Common questions

What is the difference between JSON Lines and NDJSON?

Nothing that matters. Two names for the same convention — one JSON value per line, newline separated, no enclosing array. Some tools use one extension, some the other, and both are read here.

Can it handle a multi-gigabyte log file?

No. The whole file is read into the tab, converted in memory and held as a second string. Tens of megabytes is the practical limit; beyond that `jq -c` on the command line is the right tool and will stream.

Why sort keys?

Because JSON Lines is usually compared with `diff`, and `diff` is a line comparison. Two exports of the same data with keys in different orders are entirely different lines. Sorting makes them identical text.

What happens to a nested object?

It stays nested — a JSON Lines record is a whole JSON value, so nesting is fine and nothing is flattened. If you want columns out of it, the JSON to CSV tool is the one that flattens.

Feed it from

Next

These accept what this tool produces, so the result can go straight in.