# NDJSON

One JSON value per line. A broken line is a broken line, not a broken file.

## How it opens

NDJSON parses into the records shape — many rows of the same shape, browsed as a list with a per-row view.

Nothing is chosen by file extension alone: every adapter scores the text itself and the highest confidence wins. When two are close enough that guessing would be a coin flip, the app asks instead of picking.

- extensions · .ndjson, .jsonl, .log
- media type · application/x-ndjson
- shape · records
- extra diagnostics · none beyond the parse errors

## Fixing

Records fail one at a time, so repair does too: broken rows are grouped by cause and fixed by the group, or all at once. A whole-document pipeline is never run over this format — it would glue the records together and drop the rest.

Rows that match no pattern are counted and kept, never hidden.

## Nesting

A NDJSON value can hold another system's output — a stringified body, an escaped document. Unpack opens it in place, names the parser that opened it, and repeats until nothing parses. Pack restores the original text byte for byte rather than re-serializing from the tree.

## A sample

The document below is the fixture this adapter ships and its own tests parse — not an illustration written for this page.

```
{"ts":"2026-04-21T14:32:08.412Z","level":"info","msg":"stripe.charge.completed","amount":17054}
{"ts":"2026-04-21T14:32:07.940Z","level":"warn","msg":"retry.scheduled","attempt":2}
{"ts":"2026-04-21T14:32:07.813Z","level":"error","msg":"stripe.webhook.signature_invalid"}
```

---

Canonical: https://unstringify.com/docs/ndjson
