Tools · NDJSON

NDJSON to JSON

Every line is read on its own, so one broken line is one broken line — named, fixed or left out with its number — and the rest become one array.

no signup · runs entirely in your browser · ⌘V works anywhere on this page
See it done · 9 s
NDJSON to a JSON arrayA JSON-lines log opens as records, the broken line counted; Convert, JSON writes the records as one array, the broken line left out and said so. · 9 s

What you get

  • Reads the sample as 5 records, 1 of them broken, and writes the 4 that parse as one array
  • Reads the Docker log's 5 lines the same way — a .jsonl, an .ndjson or a .log file alike
  • Names the broken line with its fix — a trailing comma, a missing quote — and fixes it alone in the app
  • Keeps every object as written: its keys in their order, its nested values nested
  • Copies or downloads the array; the app has the records view, the filter and Compare

What it will not do

  • Merge lines into one object, or sort the keys. One line is one element of the array.
  • Silently drop a broken line. It is counted, named with its line number, and the count is on the page.
  • Send your text anywhere. The page is static and the engine runs in this tab — open the network panel and watch it stay empty.

What each line becomes

Lines → one array
{"id":1} {"id":2} {"id":3}[ { "id": 1 }, { "id": 2 }, { "id": 3 } ]
A broken line

Named by its line with the fix, fixed on its own, or left out of the array with its number said — never guessed at.

A blank line

Skipped. Trailing whitespace on a line is not a record.

Keys in different orders

Each object keeps its own key order; nothing is sorted or merged.

The sample

What the first sample opens — a real file, not an illustration written for this page.

checkout-api.ndjson
{"ts":"2026-04-21T14:32:08.412Z","level":"info","msg":"stripe.charge.completed","amount":17054,"order_id":"ord_8f3aa19c4d"}
{"ts":"2026-04-21T14:32:07.940Z","level":"warn","msg":"retry.scheduled","attempt":2,"backoff_ms":400}
{"ts":"2026-04-21T14:32:07.813Z","level":"error","msg":"stripe.webhook.signature_invalid","payload":"{\"event\":\"charge.succeeded\",\"id\":\"evt_1PZ3xK\"}"}
{"ts":"2026-04-21T14:32:07.512Z","level":"info","msg":"cart.items.priced","items":2,"total":14900
{"ts":"2026-04-21T14:32:06.301Z","level":"info","msg":"session.token.issued","ttl":3600}

in VS Code

Read as records opens the lines beside the text; Convert, then JSON writes them as one array into a new editor.

unstringify for VS Code14-day trial · Free and Pro

Questions

What happens to a line that will not parse?

It is named by line with the reason. On this page the array is written from the lines that parse and says how many were left out; in the app Fix all rewrites that line alone.

Is JSONL the same as NDJSON?

Yes. Both mean one JSON value per line; the extensions .jsonl and .ndjson open the same way, and so does a .log file that holds JSON lines.

Can I get CSV instead?

Yes — the NDJSON to CSV page writes the keys as the header and one row per record.

Try it on the file that broke your afternoon.

free while in alpha · no signup