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.
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.
in VS Code
Read as records opens the lines beside the text; Convert, then JSON writes them as one array into a new editor.
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.