How to use the JSON Validator
- 1
Paste the JSON you want to check into the editor, or drop a file onto the page.
- 2
The validator runs as you type. A valid document shows no error markers.
- 3
If there is a problem, the error is underlined and a message beneath the editor gives the line, the column and the cause. Click it to jump to the spot.
- 4
For the common mistakes the editor offers an automatic repair. Accept it, or fix the text by hand, and the error disappears.
Features
- Validates against strict JSON (RFC 8259), the format APIs and config parsers expect
- Reports the exact line and column of the first error
- Explains the most common mistakes in plain English, with the fix
- Click-to-jump from the error message to the problem character
- Syntax highlighting and bracket matching make unbalanced braces obvious
- Runs entirely in your browser, so sensitive data is safe
- Format or minify the document once it passes
What makes JSON invalid
JSON has a deliberately tiny grammar: objects, arrays, strings, numbers, true, false and null. Everything else is an error. The strictness is what makes JSON portable across every language, but it also means a document that looks fine to a human can still be rejected by a server.
The validator parses your text with the same rules a browser or API uses and shows you the first problem it meets. Fix it and run again; most documents have only one or two issues.
The five mistakes that cause most errors
- Trailing commas.
{"a": 1,}is invalid. Remove the comma after the last item. - Single quotes.
{'a': 1}is invalid. Use double quotes for keys and string values. - Unquoted keys.
{a: 1}is invalid. Keys must be strings in double quotes. - Comments.
// noteand/* note */are not allowed. Strip them before sending. - Special values.
undefined,NaNandInfinityare not JSON. Usenullor a number.
Validate before you ship
Invalid JSON in a config file can take down a deploy; in an API response it breaks every client at once. Pasting the document here before committing or publishing takes a few seconds and removes an entire category of production incidents. When the document passes, the JSON Formatter will make it readable and the JSON Minifier will make it small.
Frequently asked questions
What does "Unexpected token" mean?
My JSON works in JavaScript but fails here. Why?
Does it validate against a JSON Schema?
Can it check very large files?
Is my data private?
Last updated .