Tools
JSONL Validator
Check a JSON Lines (JSONL / NDJSON) file line by line: every invalid line with its number, duplicate values for a key, and keys missing from some records. Download the valid lines, or convert between JSONL and a JSON array. Your data stays in your browser.
Runs entirely in your browser. Your data is never uploaded and never leaves this device.
Checking…
About the JSONL validator
JSONL (JSON Lines), also called NDJSON (newline-delimited JSON), stores one complete JSON value per line. It is the format behind log pipelines, data exports, BigQuery and Elasticsearch bulk loads, and machine-learning training files. Because every line must stand on its own, a single stray comma or a pretty-printed record breaks one line without breaking the file as a whole, and an ordinary JSON validator cannot tell you which line it was.
This tool checks the file line by line. Each line is trimmed of spaces, tabs and carriage returns and must then be exactly one JSON value, as JSON.parse accepts it: objects, arrays, strings, numbers, true, false and null all count. Blank lines are reported as empty, not invalid. Every invalid line is listed with its line number, a column and the reason, so you can jump straight to it. Line numbers are physical lines and include empty ones, the same numbers your editor shows.
Beyond syntax, the tool looks at the records themselves. Pick a top-level key such as id and it lists every value that appears on more than one line, with those line numbers; 1 and "1" are different values, while {"a":1,"b":2} and {"b":2,"a":1} are the same. The key summary shows which keys are missing from some object lines, a quick way to spot schema drift between records.
You can download or copy only the valid lines, convert the valid lines into one JSON array, or go the other way and turn a JSON array into JSONL with one compact value per line. Conversions copy each value’s own text instead of re-serialising it, so integers larger than 2^53 keep every digit. Everything runs in your browser: the file is never uploaded, and a 100,000-line file is checked in the background without freezing the page.
Worked example
Paste these five lines with the duplicate key set to id. Line 2 has a trailing comma, line 3 is blank, and the value 1 appears twice.
{"id":1,"name":"Ada"}
{"id":2,"name":"Linus",}
{"id":1,"name":"Grace","team":"core"}
{"id":3}Result: 5 lines, 3 valid, 1 invalid (line 2), 1 empty (line 3). Duplicate id 1 on lines 1 and 4. Key summary: name is on 2 of 3 object lines, team on 1 of 3.
[
{"id":1,"name":"Ada"},
{"id":1,"name":"Grace","team":"core"},
{"id":3}
]The invalid and empty lines are skipped but still reported above the output.
import json
with open("data.jsonl", encoding="utf-8") as f:
for number, line in enumerate(f, start=1):
if not line.strip():
continue
try:
record = json.loads(line)
except json.JSONDecodeError as e:
print(f"line {number}: {e}")The same rule the tool applies: one value per line, blank lines skipped, errors reported with the line number.
Frequently asked questions
What is the difference between JSONL and NDJSON?
None in practice. Both mean one JSON value per line, separated by a newline, and files use the .jsonl or .ndjson extension interchangeably. This tool accepts either.
Why is my pretty-printed JSON file invalid?
JSONL needs each record on a single line. A value spread over several lines is invalid on every one of them. If your file is one JSON array, switch to the "JSON array → JSONL" mode to convert it.
Are blank lines allowed in JSONL?
The JSON Lines format does not allow them, but many readers skip them. The tool counts blank and whitespace-only lines separately as empty, never as invalid, and leaves them out of every output.
Does every line have to be a JSON object?
No. Any JSON value is a valid line, including arrays, strings, numbers and null. Only object lines are used for the key summary and the duplicate check.
Is my data uploaded anywhere?
No. Validation and conversion run in your browser with JavaScript. The text you paste or the file you drop never leaves your device.
Will large numbers lose precision when I convert?
No. The outputs reuse each value’s original text, so an id such as 12345678901234567890 is copied exactly instead of being rounded through a JavaScript number.