JSON to NDJSON

  • Both ways
  • Line errors
  • Nothing uploaded

Array to one document per line, and back — with per-line error reporting.

Input
Result

Paste input on the left to see result.

Everything runs in your browser — nothing is uploaded.

About ndjson

NDJSON, also called JSON Lines or JSONL, puts one compact JSON document on each line. Log pipelines, BigQuery and Elasticsearch bulk endpoints expect it, because a reader can process a line at a time without loading the whole file. JSONic converts both directions and reports the failing line number.

NDJSON — also called JSON Lines or JSONL — puts one compact document per line. It is what log pipelines, BigQuery, Elasticsearch bulk endpoints and streaming APIs expect, because a consumer can process each line without holding the whole file in memory. Converting back reports the exact line that failed rather than a byte offset into a multi-megabyte file.

Questions

When is NDJSON better than a JSON array?

Whenever the data is a stream or is too large to hold in memory. A reader can consume one line at a time, and a writer can append without rewriting a closing bracket.

What is the difference between NDJSON, JSONL and JSON Lines?

In practice, nothing — three names for the same convention. NDJSON has a slightly stricter specification about line separators, but every common tool treats them interchangeably.

Are blank lines allowed?

They are skipped when parsing. Every non-blank line must be a complete JSON document on its own.