JSON Validator
Validate JSON with precise line & column error locations. Detects duplicate keys and number precision loss.
JSON Validation Reference
A validator does more than just detect that JSON is malformed — it gives you precise line and column numbers for every error, making it straightforward to fix problems in large documents. It also catches issues that a formatter might silently swallow: duplicate keys (where one value gets discarded), and large integers that exceed JavaScript's safe integer range (2⁵³ − 1), which parsers round without warning.
Common JSON Errors
| Error message fragment | What it means | How to fix |
|---|---|---|
| Unexpected token '}' | Missing comma between two elements or properties | Add , between properties |
| Expected double-quoted property name | Unquoted or single-quoted key | Wrap the key in double quotes |
| Trailing comma | Comma after the last element in an array or object | Remove the trailing , |
| Unterminated string | A string was opened with " but never closed | Find the unclosed " and close it |
| Unexpected non-whitespace character | Stray character such as a // comment | Remove all comments — JSON has no comment syntax |
| Duplicate key | The same key appears twice in a single object | Deduplicate keys; most parsers silently discard one |
| Number precision loss | An integer larger than 2⁵³ − 1 was parsed as a JSON number | Use a string type for large IDs (Snowflake, database bigint) |
What an invalid document looks like
{
"name": "Alice", // user name
"active": true,
}Line 2: Unexpected token '/' — JSON does not support comments Line 4: Trailing comma after last property
What JSON Validators Don't Check
Valid JSON is not the same as correct data. A validator checks syntax only — it verifies that the document is a well-formed JSON string, but it has no knowledge of what your application expects. A document can be syntactically valid yet have the wrong field names, wrong value types, missing required properties, or values outside an acceptable range. Use the JSON Schema Validator tool to define and enforce structural and type-level rules against a JSON Schema.
Frequently Asked Questions
Your files stay on your computer. Dad promised.