NDJSON Validator — Validate Newline-Delimited JSON
Validate Newline-Delimited JSON (JSON Lines) files. Detect malformed lines, BOM, empty entries, and mixed formatting — in your browser, no upload.
NDJSON Validator
Validate Newline-Delimited JSON (JSON Lines). Validates each line as JSON and reports errors. Works entirely in your browser.
NDJSON — newline-delimited JSON, also called JSON Lines — is the data format that powers every streaming data pipeline, every log aggregator, and every batch-processing workflow built since 2013. It is JSON with one rule: every line is a complete, independently parseable JSON object. This one rule makes it the ideal format for streaming because a consumer can read line N without having parsed lines 1 through N-1, can resume from any line after a crash, and can split a file across workers by simply splitting on newlines. The trade-off is that a single malformed line in the middle of a million-line file breaks whatever downstream consumer hits it first.
The validator’s job is to find that line before it reaches production. A malformed NDJSON line can be anything from a missing closing brace to a stray Unicode character introduced by a concatenation script that did not handle encoding correctly. The validator scans every line and reports the exact line number, the byte offset, and the parse error for every malformed entry. It also catches the silent errors that are not parse failures: empty lines that should not be there, trailing whitespace that bloats the file, and UTF-8 BOM bytes that survive concatenation.
The real value of the validator is not in finding the first error — any JSON parser can do that. It is that the validator continues scanning after the error and reports every issue in a single pass. A million-line NDJSON file with three broken lines can be fixed in one round-trip instead of the three separate passes a fail-on-first-error validator would require. For teams that ingest NDJSON from third-party APIs, log shippers, or cross-team data pipelines, this single-pass behaviour is the difference between a quick fix and a debugging session that spans hours.
How to use
Paste or drop an NDJSON file
Drop a .ndjson or .jsonl file into the input, or paste NDJSON text. The validator scans every line and reports which lines are valid JSON, which are malformed, and which are empty.
Review the line-by-line report
Each line gets a status badge: valid (green), invalid JSON (red with the parse error), empty (grey), or comment (blue if the first non-whitespace character is #). Click a red line to jump to it in the source.
Filter to valid lines
The filtered view shows only valid JSON lines. Copy them to your clipboard or download as a cleaned .ndjson file. Invalid lines are stripped, reducing a messy stream to a clean one.
Frequently asked
What counts as an empty line in NDJSON?
A line containing only whitespace characters is treated as empty and flagged separately from a malformed line. Trailing newlines at the end of the file do not count as empty lines. You can configure whether empty lines should be treated as warnings or errors.
Does it detect duplicate objects across lines?
No — the validator checks line-by-line JSON validity, not inter-line semantic consistency. Two identical JSON objects on separate lines are both valid. For semantic deduplication, pipe the output through a deduplication tool.
How does it handle a UTF-8 BOM at the start of the file?
A byte-order mark (EF BB BF) at position zero is silently stripped before the first line is parsed. If a BOM appears mid-stream (rare but possible in concatenated NDJSON), the line containing it is flagged as invalid. Toggle the 'strip all BOMs' option to handle concatenated files.
Can I validate against a JSON Schema?
No in the validator — but you can pair it with the JSON Schema Generator tool. Generate a schema from a valid NDJSON sample, then apply it to subsequent files. The validator focuses on syntactic validity; schema enforcement is a separate step.
What's the difference between NDJSON and JSON Lines?
They are the same format. NDJSON (.ndjson) and JSON Lines (.jsonl) both define a newline-delimited stream of JSON objects where each line is independently parseable. The terms are interchangeable; this tool accepts both extensions.
Limitations
- No streaming for very large filesThe validator loads the entire file into browser memory. For files exceeding tab memory, split the file with a command-line tool and validate each chunk separately.
- Line-by-line only, not multi-line JSON objectsNDJSON requires each JSON object to occupy exactly one line. Multi-line JSON on a single logical entry is not valid NDJSON and is flagged as malformed on the first line break.
- No semantic field-level validationThe validator confirms that line N is valid JSON. It does not check whether the fields or types match a schema or whether values are within expected ranges. That is the job of a downstream validation step.
Platform notes
- macOS
- For command-line validation, `cat file.ndjson | jq empty` validates each line. The browser tool adds the line-numbered error report and the one-click filter-to-valid-lines that CLI tools do not expose.
- Linux
- The `jsonlines-validate` Python package does the same from the command line. The browser tool is the right pick for interactive inspection of NDJSON pasted from a chat or email.
- Web
- Runs entirely client-side. Works offline once loaded.