Skip to main content
Convert2JSON
ConvertersBrowser processing

JSON to NDJSON Converter

Split a JSON array into newline-delimited JSON — one complete record per line, which is what bulk loaders and streaming consumers actually want.

Input

JSON array
characters
0
lines
0
size
0 B

Options

Your data stays on your device.Parsing, conversion and code generation happen in this browser. Input is not uploaded to Convert2JSON servers.Privacy policy

About this tool

NDJSON, also written JSON Lines or .jsonl, exists so that a consumer can process one record at a time without holding the whole file in memory. That is why it is the format BigQuery loads, Elasticsearch bulk-indexes, and nearly every LLM fine-tuning pipeline expects for its training data.

The conversion itself is simple, and the detail that matters is the one people get wrong by hand: each record must be minified onto a single line. In NDJSON the line break is the record separator, so a pretty-printed record spanning several lines is not merely ugly — it is a different, broken file.

A single object is treated as a one-record file rather than an error, because that is a legitimate thing to want and failing on it would be pedantry.

How to use this tool

  1. Paste a JSON array, or upload a .json file.

  2. Choose whether to end the output with a trailing newline — most loaders prefer one.

  3. Press Convert.

  4. Copy the result, or download it as a .ndjson file.

Key features

  • One complete JSON value per line, minified so the line break stays the separator
  • Optional trailing newline for loaders that expect one
  • A single object accepted as a one-record file
  • Line feeds only — never carriage returns, which the NDJSON spec forbids
  • Record count reported so you can check it against the source
  • Runs in your browser; the dataset is never uploaded

Example

An array of two records

InputJSON

[
  { "id": 101, "name": "Ha-eun" },
  { "id": 102, "name": "Marco" }
]

OutputNDJSON

{"id":101,"name":"Ha-eun"}
{"id":102,"name":"Marco"}

Good to know

  • The whole document is parsed in memory, so this is not a streaming converter. A file too large for the browser tab is too large for this tool.
  • Arrays nested inside a record are left as they are — only the top-level array is split into lines.
  • A top-level scalar cannot become a record. Wrap it in an array first.

Frequently asked questions

Is NDJSON the same as JSON Lines and .jsonl?

For practical purposes yes — the layout is identical. The NDJSON specification is explicit that the separator is a line feed, which is why this converter never emits carriage returns.

Why is each record minified?

Because the newline is the record separator. A record pretty-printed across several lines would be read as several broken records, so indentation is not a formatting preference in this format.

Should I include a trailing newline?

Usually yes. Most bulk loaders accept a file either way, but tools that concatenate files rely on the final newline to keep the last record separate from the first record of the next file.

Can I convert back?

Yes — use NDJSON to JSON, or press Swap. The round trip is lossless.

Further reading

What is NDJSON? NDJSON is JSON with one complete value on each line and no array around it. That one change is what makes a file streamable — and what breaks it if you pretty-print it.

Your data stays on your device

Your data is processed locally in your browser and is not uploaded to our server. This page keeps working after you go offline, because there is nothing to send.