CoreJSON

NDJSON to JSON

This converter merges NDJSON (JSON Lines) into a single JSON array. Each line is parsed on its own and appended to the array in file order, so the result can be read with JSON.parse or sent to an API that only accepts an array. Indentation and key sorting are configurable, and the conversion runs entirely in your browser — nothing is uploaded.

Open in the workbench Runs locally · nothing is uploaded

How to use it

  1. 1

    Paste your NDJSON

    Drop line-delimited JSON into the editor, or pick a local .jsonl file. The data is read on your machine only.

  2. 2

    Choose an output indent

    Select 2 spaces, 4 spaces or a tab, or keep the output compact as a single line.

  3. 3

    Let it merge automatically

    About 400ms after you stop typing it parses each line in a Web Worker and merges them into one array.

  4. 4

    Copy the result

    Copy the JSON array in one click, or flip the direction to split the array back into NDJSON.

Key features

Line-by-line merging

Every line is parsed on its own and appended in order; an invalid line reports its line number instead of failing the whole document.

Indent and key sorting

Beautify or minify the array and recursively sort keys for stable, easy-to-compare output.

Reversible in one page

The same page converts a JSON array back to NDJSON, so you never have to switch tools.

Order is preserved

The array keeps the exact order of the input lines.

Local and private

Parsing runs in a Web Worker in your browser; nothing is uploaded.

Handles large logs

Worker-based parsing keeps multi-megabyte log files responsive.

Common errors & troubleshooting

  • ! The input must be one JSON value per line; if you have a single multi-line JSON document, minify it first or use the reverse mode.
  • ! Blank lines are skipped by default, and leading or trailing whitespace on a line does not affect parsing.
  • ! If one line fails, the error names the line number and the reason — fix that line and the array is recomputed automatically.
  • ! A trailing newline at the end of the file is harmless; it is treated as a blank line and ignored.

Frequently asked questions

Does the array keep the same order as the file?

Yes. Elements are appended in exactly the order the lines appear.

What happens if one line is not valid JSON?

The tool reports the specific line number and reason, and recomputes once you fix it. You can also check for hidden blank lines if you expect more records.

Can I convert the array back to NDJSON?

Yes — flip the direction on the same page to split the JSON array into one record per line. The two tools are inverse operations.

Is my data uploaded?

No. The conversion runs locally in your browser; nothing leaves your device.

Related tools