JSON Validator
Check whether JSON is valid and find errors fast: the exact line and column, the surrounding lines, and a summary of the structure when it is valid.
Valid JSON
- Root
- Objects
- Arrays
- Keys
- Values
- Depth
Invalid JSON — Line , column
Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.
How to use the JSON Validator
- 1 Paste or type your JSON.
- 2 See immediately whether it is valid; if not, the error is highlighted with its line and column.
- 3 Fix the problem, or press Format to pretty print valid JSON.
About the JSON Validator
A JSON validator checks whether text follows the JSON syntax (RFC 8259): objects in braces, arrays in brackets, keys and strings in double quotes, and values separated by commas. One misplaced character makes a whole document unreadable for a program, so a quick check saves a lot of debugging.
The validator uses your browser's JSON parser. For invalid input it shows the parser's message, the line and column where parsing failed and the lines around it with a caret under the position. The real mistake is often just before that point, for example a missing comma at the end of the previous line.
For valid JSON you see what kind of value the root is and how many objects, arrays, keys and plain values the document contains, plus the deepest nesting level. That helps when checking API responses or large configuration files.
Frequently asked questions
What are the most common JSON errors?
Trailing commas, single quotes, unquoted keys, comments, and special values such as undefined or NaN. JSON only knows strings, numbers, true, false, null, objects and arrays.
Does the validator check my data against a schema?
No, it checks the syntax only. Whether the data has the right fields and types is a job for JSON Schema validation.
Why is the error position after the actual mistake?
The parser reports where it noticed something was wrong. A missing comma or closing quote is usually detected at the start of the next token, so look just before the marked position too.
Are duplicate keys an error?
JSON parsers in browsers accept duplicate keys and keep the last value. The standard says keys should be unique, so it is better to avoid them.