How to validate JSON
- Paste your JSON into the editor, or drop a
.jsonfile on it. - Click Validate (or press
Ctrl+Enter). - If the JSON is valid, it is re-indented so it's easy to read. If not, the error message gives the exact line and column and shows the lines around it, with a
^marker under the character where parsing failed. - Click Repair to fix the usual problems automatically, then validate again.
The most common JSON errors
| Error | Example | Fix |
|---|---|---|
| Trailing comma | {"a": 1,} | Remove the last comma |
| Single quotes | {'a': 'x'} | JSON only allows double quotes |
| Unquoted key | {a: 1} | Put keys in double quotes: "a" |
| Comments | // note | JSON has no comments; remove them |
| Missing comma | {"a": 1 "b": 2} | Separate items with commas |
True, None, NaN | Python or JavaScript values | Use true, false and null |
| Unescaped characters | A raw line break or " inside a string | Write \n and \" |
Repair fixes all of these: it adds missing commas and quotes, removes comments and trailing commas, converts single quotes, and closes brackets that were cut off.
Syntax validation vs schema validation
This page checks syntax: whether the text is JSON at all. To check that valid JSON also has the right shape (required fields, types, allowed values), use the JSON Schema validator, which lists every value that breaks a rule, by path.
Exact numbers, private data
Many online validators run JSON through JavaScript's own parser, which silently rounds long numbers such as 19-digit IDs. This validator keeps every digit exactly as you typed it. Validation runs in your browser, so the JSON you paste isn't uploaded.
Frequently asked questions
How do I know if my JSON is valid?
Paste it into the editor above and click Validate. Valid JSON is re-indented; invalid JSON shows an error with the exact line and column where parsing failed.
What does "Unexpected token" mean?
The parser found a character it did not expect at that position, usually a missing comma, a stray quote, a single quote instead of a double quote, or a comment. Look at the character just before the reported position.
Can it fix my JSON automatically?
Yes. Click Repair to add missing commas and quotes, remove trailing commas and comments, convert single quotes and close unclosed brackets. Check the result, because repair has to guess what was intended.
Does it validate against a JSON Schema?
This page checks syntax only. For schema validation, use the JSON Schema tool, which supports drafts 4 to 2020-12.
Is my JSON uploaded?
No. Validation, formatting and repair run in your browser.