JSONL Validator
JSONL validator. Line-by-line syntax check of a JSONL (JSON Lines) file. Shows the exact line number and parse error for every bad row. Up to 1 GB, runs in your browser.
100% client-side. Your data never leaves this page — no upload, no server.
Validate
JSONL Validator
Paste or drop a JSONL / NDJSON file. Each line is parsed individually; every bad line reports its line number and the exact JSON parser error.
What this tool does
It checks a JSONL / NDJSON file one line at a time. Each line is handed to the JSON parser on its own; if it parses, the line counts as valid, and if it doesn't, the line is listed with its line number, the parser's error message, the column where parsing broke, and a suggested fix. Blank lines are flagged too — strict JSONL has no empty lines. The status bar summarises the run as V of T lines parsed OK. Everything runs in your browser; nothing is uploaded.
This is the everyday intent: "something downstream rejected my file and I need to know exactly which lines are broken and why." It's a syntax check — it proves each line is legal JSON. It does not check structure or schema; if you need to confirm a fine-tune dataset has the right keys and roles, use the schema-aware validators (OpenAI, Anthropic) or the JSON Schema validator.
When you'd reach for it
- Find the one bad line in a 50,000-line export. Click Validate and read the line number — no scrolling, no guessing.
- Salvage a partly-corrupted file. Click Download valid lines only to write a
clean.jsonlwith the broken and blank lines dropped, so the rest of your data still loads. - Pre-flight before an ingest or training run. A single malformed line can abort a whole pipeline; catch it here first.
- Diagnose a parser error you can't read. The per-line hint translates cryptic messages (BOM, smart quotes, trailing comma, unquoted key) into a plain-English fix.
- Confirm a hand-edited file is still strict JSONL. Blank lines and stray array wrappers get flagged, not silently tolerated.
- Decide whether to repair or discard. See how many lines are bad before choosing between the auto-fixer and the clean-download.
How validation works
Parse each line independently
The input is split on newlines and every line is parsed as a standalone JSON value. A line that parses increments the valid count. A line that doesn't is recorded as a problem. One bad line never stops the run — the validator reads to the end and reports everything at once.
Blank lines are flagged, not skipped
An empty or whitespace-only line is reported as a problem (blank line (JSONL should not contain empty lines)), because strict NDJSON has no blank lines between records and some loaders choke on them. This is deliberate: many tools silently drop blanks and hide a formatting issue you'd rather know about.
What each error row shows
For every bad line you get the line number, the raw line text, the column where the parser gave up, and a one-line suggested fix when the cause is recognisable. The error list shows up to 200 entries; beyond that it notes how many more weren't rendered, so a thoroughly broken file doesn't lock up the page.
Download valid lines only
This walks every line, keeps the ones that parse, drops blanks and failures, and downloads the survivors as clean.jsonl. It's a fast way to rescue good data — but note it discards broken lines rather than repairing them. If you'd rather fix the breakage (strip a BOM, straighten smart quotes, remove trailing commas), use the auto-fixer instead.
Input format reference
Each line in a valid JSONL file must be a complete JSON value. JSON has six value types:
| Type | Example line | Notes |
|---|---|---|
| Object | {"id": 1, "name": "Alice"} | Most common JSONL shape. Keys must be double-quoted strings. |
| Array | [1, 2, 3] | Legal but uncommon. Mixed object/array lines parse fine but defeat most tooling. |
| String | "hello world" | Double quotes only; escapes follow JSON rules. |
| Number | 3.14 · -42 · 1e6 | No leading zeros, no NaN / Infinity. |
| Boolean | true · false | Lowercase only. |
| Null | null | Lowercase. Distinct from a missing key. |
What this validator checks
It enforces one rule per line — "is this legal JSON?" — plus the no-blank-lines rule. These are the failures it reports, with the fix the per-line hint suggests. The companion auto-fixer applies the same repairs in batch.
| What you wrote | Why it fails | Fix |
|---|---|---|
{'id': 1} | Single quotes around keys/values. | {"id": 1} |
{id: 1} | Unquoted key. | {"id": 1} |
{"id": 1,} | Trailing comma. | {"id": 1} |
{"x": NaN} | NaN / Infinity / undefined are not JSON. | Use null or a sentinel string. |
{"name": "Tom\nW"} (raw newline) | Literal newline inside a string breaks JSONL's line boundary. | Escape as \n. |
[{"id":1},{"id":2}] | Whole file wrapped in a JSON array. | One object per line (use JSONL ↔ JSON to convert back). |
{"id": 01} | Leading zero on a number. | {"id": 1} |
{"q": "Where is "Tom"?"} | Unescaped inner double quote. | "Where is \"Tom\"?" |
| Smart / curly quotes | “ ” ‘ ’ aren't ASCII quotes. | Replace with straight " quotes. |
| BOM at file start | UTF-8 BOM (EF BB BF) ends up at the front of line 1. | Save without BOM, or run through the auto-fixer. |
| blank line between records | Strict NDJSON allows no empty lines. | Remove the blank line. |
{"id": 1} {"id": 2} on one line | Two JSON values concatenated without a newline. | Split onto two lines. |
Example
Input with a syntax error on line 3:
{"id": 1, "status": "ok"}
{"id": 2, "status": "ok"}
{"id": 3, "status": error}
Validation result:
Line 3: invalid JSON — Unexpected token 'e' … (col 17)
hint: Unexpected character near "error}". Check that strings are quoted.
Line 3 fails because error is a bare word rather than a quoted string or a boolean. The exact wording of the parser message varies by browser, but the line number, the column, and the hint do not.
Recipes by intent
Rescue the good data and move on
Validate, then click Download valid lines only. You get clean.jsonl with every parseable line and nothing else — broken and blank lines removed. Good when a few corrupt rows are blocking an import.
Repair instead of discard
If the breakage is mechanical (BOM, smart quotes, trailing commas, comments), send the file through the auto-fixer, which rewrites the lines rather than dropping them, then re-validate here.
Validate in your own pipeline or CI
Once a file is clean, gate it programmatically. All three of these read stdin so you can pipe:
import json, sys
for i, line in enumerate(sys.stdin, 1):
line = line.strip()
if not line: continue
try:
json.loads(line)
except json.JSONDecodeError as e:
print(f"line {i}:{e.colno}: {e.msg}")
# jq exits 0 only if every line parses as JSON.
jq -e -c 'true' < data.jsonl > /dev/null && echo ok
Limits and performance
- Memory-bound. The whole text sits in browser memory while it's validated. Files up to ~100 MB usually finish in a few seconds; ~500 MB is the practical desktop ceiling.
- Pasting vs. dropping. For very large inputs, drop the file rather than copy-pasting — browsers handle file reads far better than a giant string in the textarea.
- Only the first 200 errors render. Beyond that the list notes how many more were found, to keep the page responsive on a thoroughly broken file.
- Gigabyte-scale files belong on the CLI.
jq -e -c 'true' < data.jsonlstreams without loading everything into memory.
Errors and how to fix them
The error says "Unexpected token ]" but I don't see a bracket
JSON parser messages are terse. This usually means the parser expected something else — a comma, a value, a closing quote — and reached the end of the structure too early. Look at the characters just before the column number in the error, not at a literal ].
It flagged a blank line — is that really an error?
By the strict NDJSON definition, yes: there are no empty lines between records. Many loaders tolerate them, but some don't, so the validator surfaces them. Use Download valid lines only or the auto-fixer to drop them.
Why didn't it catch my missing "role" key?
This is a syntax validator — it only checks that each line is legal JSON. To enforce a structure (required keys, allowed roles), use a schema-aware tool: the OpenAI / Anthropic fine-tune validators, or the JSON Schema validator.
It rejects comments in my file
Standard JSON has no // or /* */ comments, so they're flagged as syntax errors. The auto-fixer can strip them for you.
My browser tab freezes on a huge file
The validator works over the whole text at once. For files past a few hundred MB, clear the textarea and use the file drop zone instead of pasting, or validate on the CLI with jq.
FAQ
Does my data get uploaded anywhere?
No. It runs entirely in your browser — the "upload" is a local file read and the "download" is a Blob URL. Your data never touches a server. See the privacy policy.
What's the difference between JSONL and NDJSON?
For almost every practical use, the same thing: newline-delimited JSON. Some specs are slightly stricter about trailing or blank lines; this tool treats them interchangeably and flags blank lines either way.
Is this the same as schema validation?
No. It validates that each line is legal JSON, not that it matches a structure. For schema checks use the JSON Schema validator or a provider-specific fine-tune validator.
Is there a command-line equivalent?
Yes, and it's better for giant files: jq -c . file.jsonl > /dev/null. If a line is broken, jq tells you which one. It's the gold standard for CLI work.