The JSON Validator checks whether text is valid JSON, and if it is not, gives the line, column, and a plain-English fix for the first error. Valid documents get a structure summary plus warnings about problems JSON.parse silently accepts, such as duplicate keys and numbers too large to store exactly.
Input
{"a": 1,}
Output
Invalid: Trailing comma before "}". (line 1, column 9) Fix: remove the comma after the last property.
Input
{'name': 'Ada'}
Output
Invalid: Property names must use double quotes. (line 1, column 2) Fix: replace the single quotes with double quotes.
Input
{"id": 1, "id": 2}
Output
Valid JSON · warning at $: Duplicate key "id": JSON.parse keeps only the last value.
Input
{"total": 12345678901234567890}
Output
Valid JSON · warning at $.total: the number is larger than JavaScript can store exactly, so it will lose precision when parsed.
Validity is decided by the strict JSON grammar in RFC 8259. Strings and property names need double quotes, the only literals are true, false, and null in lowercase, numbers cannot start with + or . or have leading zeros, and there are no comments or trailing commas. Each of those rules is a common reason that a hand-edited config file or a JavaScript object pasted from code fails to parse.
Error messages come from a dedicated parser that reads the text once, character by character, and stops at the first problem. That is why the validator can say "Trailing comma before }" or "Strings must use double quotes" instead of the browser's generic "Unexpected token". It also recognises specific mistakes: capitalized True or NULL, undefined, NaN, and Infinity (which are JavaScript but not JSON), invalid escapes like \x, \u escapes without four hex digits, and raw line breaks or tabs inside a string. Line and column numbers count from 1, and the column points at the character that caused the error.
Two kinds of valid JSON still cause bugs, and the validator warns about both. Duplicate keys are allowed by the grammar, but JSON.parse in browsers and Node keeps only the last value, while some other languages keep the first or throw an error, so the same file can mean different things to different services. Integers beyond 9,007,199,254,740,991 lose precision in JavaScript, which quietly corrupts 64-bit database IDs and Twitter-style snowflake IDs. Each warning shows a JSONPath-style location such as $.items[3].id so you can find it in a large file.
The stats summarize structure at a glance. Depth is the deepest level of nesting, where a flat object is 1. Objects, Arrays, and Keys count every occurrence in the document, and Size is the UTF-8 byte length. Very deep documents beyond 1,000 levels are still checked for validity but skip the detailed analysis. To reformat with a choice of indentation and download the result, use the JSON formatter; to check a JSON Web Token instead, use the JWT decoder.
More Developer Tools