Developer Tools Runs in your browser Free · no account

NDJSON Formatter

NDJSON stores one complete JSON value per line, which lets a consumer stream records without holding the whole file in memory. This tool converts a JSON array into NDJSON and back, reporting the exact line number when a record fails to parse.

Options
Input 0 characters
Result

Your result will appear here.

Not sure where to start? Use Load example.

Results update automatically and are calculated on your device. Nothing you type is sent to a server.

Runs in your browser. Processing happens entirely in your browser. Nothing you enter is sent to Delimiter.live.

How to use the NDJSON Formatter

  1. Paste an NDJSON file, or a JSON array if you are converting the other way.
  2. Choose the direction.
  3. Read the record count to confirm every line was recognised.
  4. Copy or download the result.

Example

Input
{"id":1}
{"id":2}
Output
[
  {
    "id": 1
  },
  {
    "id": 2
  }
]

Common use cases

  • Turning a log export into a JSON array a script can load in one go.
  • Producing NDJSON for a bulk import API that expects one record per line.
  • Inspecting a few records from a streaming data dump.
  • Converting a JSON Lines dataset into a form a spreadsheet converter accepts.

Limitations and things to watch for

  • NDJSON requires each record to sit entirely on one line. A pretty-printed JSON object spanning several lines is not valid NDJSON and will be reported as a parse failure on its first line.
  • Converting an array to NDJSON minifies each record onto a single line, so any original formatting inside a record is lost.
  • Blank lines are skipped rather than treated as records, which matches how most NDJSON consumers behave.

Frequently asked questions

What is the difference between NDJSON and JSON Lines?
In practice, nothing. NDJSON, JSON Lines and the .jsonl extension all describe the same format: one complete JSON value per line, separated by newlines. This tool handles all of them.
Why use NDJSON instead of a JSON array?
Because it streams. A consumer can process one line at a time without parsing the whole file, and a producer can append records without rewriting the closing bracket. That matters for logs and large exports.
Why did line 3 fail to parse?
Most often because a record was pretty-printed across several lines, so line 3 is only a fragment. Every non-empty line in NDJSON must be one complete JSON value on its own.
Are trailing blank lines a problem?
No. Blank lines are skipped rather than counted as records, so a trailing newline at the end of a file is handled normally.

Share this tool