NDJSON / JSON Lines

Client

Work with newline-delimited JSON: turn log-style lines into a single JSON array, or explode an array back to one compact JSON value per line—useful for streaming data, NDJSON exports, and quick validation—all parsed in your browser.

Learn more: NDJSON and JSON Lines

Handle newline-delimited JSON: many systems emit or consume one JSON object or value per line (logs, streaming APIs, data lakes). This page merges lines into an array or splits an array back into lines.

Why one JSON per line

NDJSON (often called JSON Lines, `.jsonl`) lets you append records without wrapping the whole file in an array, and you can process a huge file line by line. It is not the same as a single pretty-printed JSON document with newlines inside strings—each line must be a complete JSON value on its own.

Arrays vs lines

A JSON array `[a,b,c]` is one value containing many entries; NDJSON represents the same three items as three lines. Converting between them is useful when a tool expects one format and you have the other.

NDJSON & JSON array

?

NDJSON (newline-delimited JSON, sometimes called JSON Lines) stores one JSON value per line—common for logs and streaming exports. Lines → array parses each non-empty line and builds a JSON array in the right panel. Array → lines does the reverse for arrays (or a single value as one line).

Pretty-print puts each record on multiple lines with a blank line between records; minify keeps one compact JSON object per line.

Each non-empty line must be one complete JSON value. Blank lines are ignored when merging into an array.

Common use cases

  • Turn log files or streaming exports (one JSON object per line) into a single array for quick inspection or downstream tools.
  • Split a JSON array back into newline-delimited values for NDJSON APIs, bulk loaders, or line-oriented storage.
  • Validate and pretty-print each line when only part of a large file is malformed.

Common mistakes to avoid

  • Mixing plain text with JSON lines

    Every non-empty line must be one complete JSON value. Banner lines, stack traces, or trailing commentary will break parsing—strip them first.

  • Expecting a trailing comma between lines

    NDJSON is not a JSON array literal. There are no commas between lines; each line is standalone.

FAQ

Is NDJSON processing done on your servers?

No. Lines are read and transformed in your browser; nothing is uploaded.

How is this different from a normal JSON formatter?

A classic formatter expects one JSON document. NDJSON tools work on many documents separated by newlines—common for logs and streaming data.

Related utilities you can open in another tab—mostly client-side.