NDJSON / JSON Lines

NDJSON / JSON Lines: one JSON object per line

NDJSON (newline-delimited JSON) stores many JSON objects as separate lines. It’s popular for logs, data pipelines, and streaming.

What it looks like

Each line is valid JSON by itself:

{"ts":"2026-03-19T10:00:00Z","level":"info","msg":"started"}
{"ts":"2026-03-19T10:00:01Z","level":"warn","msg":"retrying","attempt":2}
{"ts":"2026-03-19T10:00:02Z","level":"info","msg":"done"}

How it differs from a JSON array

A JSON array is one JSON document:

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

NDJSON is many JSON documents separated by newlines.

Why it’s useful

Common mistakes

Related: Large JSON tips · Validate JSON