JSON's syntax rules are strict — unlike some programming languages, a parser won't guess what you meant. One misplaced character and the entire document fails to parse.
What "validating" JSON actually checks
Validation confirms your text follows JSON's exact grammar: matched brackets and braces, double-quoted strings and keys, correctly placed commas, and valid value types (strings, numbers, booleans, null, objects, arrays). A validator doesn't check whether the data makes sense for your application — only whether it's syntactically valid JSON at all.
The most common JSON errors
- Trailing commas —
{"a": 1, "b": 2,}— the extra comma after the last value is invalid, even though it's allowed in many programming languages. - Single quotes — JSON requires double quotes for strings and keys;
{'a': 1}isn't valid JSON. - Unquoted keys —
{a: 1}needs to be{"a": 1}. - Missing or extra brackets/braces — especially in deeply nested structures, easy to lose track of by hand.
- Comments — plain JSON has no comment syntax at all;
// like thiswill break parsing.
How to validate JSON and fix errors
- Paste your JSON into the JSON Validator.
- If it's invalid, you'll see the exact line and column where parsing failed — start there, not at the beginning of the document.
- Fix that specific issue and re-check; sometimes one error hides a second one right after it, so it can take a couple of passes.
- Once valid, you can also run it through the JSON Formatter for readable, indented output.
A quick debugging tip
When an error points to a line that looks fine, check the line before it — a missing comma or unclosed bracket often only becomes a syntax error once the parser reaches the next token.
FAQ
Why does my JSON work in one programming language but fail validation here? Some languages' JSON parsers are more lenient than the JSON specification technically allows (like tolerating trailing commas). A strict validator follows the actual spec, which is what most production systems and APIs expect.
Is JSON Validator different from JSON Formatter? Validation checks whether your JSON is syntactically correct; formatting re-indents already-valid JSON for readability. Use Validator first if you're not sure your JSON is well-formed.
Can I validate a very large JSON file? Yes, though extremely large files may take a moment longer to process — the check itself works the same way regardless of size.
Validate your JSON now
Try the free JSON Validator for instant, precise error locations. See more developer tools.
Related reading
Once your JSON is valid, see What Is JSON and How Do You Format It Correctly? for formatting it. Browse the full blog for more guides.
