NDJSON to JSON Converter

Convert NDJSON (JSON Lines) into a pretty JSON array, or split an array back into one object per line, in your browser.

The NDJSON to JSON Converter runs entirely in your browser. The newline-delimited JSON and arrays you paste are parsed on your device and never uploaded to ArrayKit.

Open the JSON Formatter

About NDJSON to JSON

The NDJSON to JSON Converter reshapes newline-delimited JSON — the JSON Lines format used by log streams, API exports, and data pipelines — into a single pretty-printed JSON array you can read or feed to a parser. It reads one JSON value per line, skips blank lines from trailing newlines, and reports how many objects it collected. When a line will not parse, it tells you the exact line number so you can jump straight to the broken record. Flip the mode to turn a JSON array back into NDJSON, emitting one compact object per line for tools like jq, BigQuery, or bulk importers that expect JSON Lines. It suits data engineers, backend developers, and anyone wrangling exports. Every conversion runs on your device, so the records you paste never leave your browser.

Features

How to use the NDJSON to JSON

  1. Keep NDJSON → JSON selected for the common direction
  2. Paste your NDJSON, with one JSON value per line, into the input
  3. Read the pretty JSON array on the right and check the object count
  4. Copy or download the result, or switch to JSON → NDJSON to reverse it

Example

Input

{"id":1,"name":"Ada"}
{"id":2,"name":"Linus"}

Output

[
  { "id": 1, "name": "Ada" },
  { "id": 2, "name": "Linus" }
]

Two NDJSON lines become a two-element pretty JSON array.

Common errors & troubleshooting

Frequently asked questions

What is the difference between NDJSON and a JSON array?
NDJSON (also called JSON Lines) puts one independent JSON value on each line with no surrounding brackets or commas, so it streams record by record. A JSON array wraps all the values in [ ] separated by commas and must be parsed as one document. This tool converts between the two.
How do I convert JSON Lines (.jsonl) to a JSON array?
Paste the contents of your .jsonl file into the input with NDJSON → JSON selected. Each line is parsed as one value and collected into a pretty-printed array, and the tool shows how many objects it read.
Can I turn a JSON array back into NDJSON?
Yes. Switch to JSON → NDJSON and paste a JSON array. Each array element is written on its own line as a compact single-line JSON value — the JSON Lines format expected by jq, BigQuery, and bulk importers.
Why does the converter report a specific line number?
NDJSON is line-oriented, so a single malformed record only breaks its own line. The tool stops at the first line it cannot parse and reports that 1-based line number, letting you fix the offending record instead of hunting through the whole file.
Does the tool skip blank lines in NDJSON?
Yes. Blank and whitespace-only lines — common from a trailing newline at the end of a file — are ignored, so they do not appear as null entries or trigger a parse error. Only non-empty lines count toward the object total.
Is my NDJSON data uploaded when I convert it?
No. The NDJSON to JSON conversion runs entirely in your browser using the built-in JSON parser. The records you paste never leave your device and nothing is sent to ArrayKit.

Related tools

All ArrayKit tools