JSON Lines (NDJSON) Viewer
Validates newline-delimited JSON one line at a time -- a bad line is reported with its line number without breaking the rest -- and converts between NDJSON and a single JSON array.
Paste NDJSON and click Run.
About This Tool
NDJSON (also called JSON Lines, .jsonl) puts one complete JSON value per line instead of one
big array or object -- the format log pipelines, streaming APIs, and ML dataset exports favor because a
reader can process records one at a time, and one corrupt line doesn't poison the whole file. This tool
parses each line independently with the same lenient parser used across this site, reports exactly which
lines are valid or broken (with line number and error), and converts in either direction between NDJSON
and a standard JSON array.
For a single JSON document that's already an array or object, use JSON Formatter or JSON Validator instead -- those validate the document as a whole rather than line by line.
Key Features
- Independent per-line validation: every line is parsed on its own; one broken line never blocks the rest.
- Line-numbered error report: invalid lines show their exact line number and parse error.
- NDJSON → JSON Array: wraps every successfully-parsed line into one JSON array, skipping invalid lines.
- JSON Array → NDJSON: flattens a JSON array back into one compact value per line.
- Blank lines ignored: not reported as errors in either direction.
- File upload: load a
.jsonl,.ndjson, or.jsonfile directly.
Example
NDJSON input with one broken line:
{"id": 1, "event": "login"}
{"id": 2, "event": "click"
{"id": 3, "event": "logout"} produces this report:
Line 1: valid Line 2: INVALID, Unexpected end of JSON input Line 3: valid