JSON Lines Validator
Check a JSON Lines file before a pipeline or training job chokes on it. Every line is parsed on its own; invalid lines are listed with their line number and the exact reason, such as a trailing comma or an unclosed quote. The validator also checks that every record is an object and compares records with each other, so missing keys, likely typos and values that change type are found too.
- Runs in your browser
- No sign-up
- Free to use
How to use JSON Lines Validator
- Paste JSON Lines or open a .jsonl file.
- Choose whether records must be objects and consistent.
- Read the report of invalid lines and key issues.
- Fix the source, or clean it with the JSON Lines Formatter.
JSON Lines Validator features
Line-by-line parsing
Each invalid line reported with its number and reason.
Object check
Flags arrays, strings or numbers where objects are expected.
Consistency check
Keys present in only some records, with likely typos highlighted.
Type check
Keys whose values change type, such as "3" versus 3.
Format hints
Detects pretty-printed records and byte-order marks.
Local
Validation runs in your browser.
When to use JSON Lines Validator
- Checking a fine-tuning or evaluation dataset before uploading it.
- Validating log exports before loading them into an analytics tool.
- Finding the one bad line that makes an import fail.
- Reviewing the schema of an unfamiliar NDJSON file.
JSON Lines Validator FAQ
What makes a JSON Lines file valid?
Every non-empty line must be a complete JSON value on its own, encoded as UTF-8. Most tools also expect each value to be an object.
Why does a pretty-printed record fail?
Readers parse the file line by line, so a record spread over several lines is read as several invalid fragments. Put each record on one line.
What is the consistency check for?
Datasets usually expect the same fields in every record. Keys missing from most records often reveal typos, and a field that is sometimes a string and sometimes a number causes errors later.
Are blank lines errors?
They are reported but not counted as errors, because most readers skip them. The formatter removes them.
Is there a size limit?
The validator handles files of many megabytes in the browser; very large files may take a few seconds.
Is my file uploaded?
No. Validation happens in your browser.
Validating line-delimited JSON
JSON Lines files are often generated by programs and consumed by other programs, with nobody looking at them in between. When something goes wrong, such as an interrupted write, a hand edit or a bug in an exporter, the consuming program usually fails with a terse message about one line and stops. Validating the whole file at once shows every problem and its location.
Each line is parsed independently with a strict JSON scanner that explains what went wrong: a trailing comma before a closing brace, an unescaped quote, a missing value. Lines that contain valid JSON but not an object, such as an array or a bare string, are reported when records must be objects, which is what machine-learning and analytics tools require.
Structural problems are found by comparing records. The validator lists every key with the types it takes and the number of records that contain it. A key present in only one or two records out of many is usually a misspelling of another key, and a field that alternates between string and number, such as an id written as "3" in one line and 3 in another, is a common source of type errors downstream.
Two formatting issues get specific hints. Records pretty-printed across several lines produce a run of errors starting with a lone brace, so the report explains the cause instead of listing every fragment. A byte-order mark at the start of the file is reported because some readers fail on it.
The report can be copied or downloaded to share with whoever produces the file. To repair a file, the JSON Lines Formatter rewrites valid records one per line and can drop invalid lines.