How to Fix Common JSON Errors (Free Validator)
9/29/2026 • json, how-to, validator, developers
"Unexpected token" with no clue where to look is the worst kind of error. Paste your JSON into a validator that shows the exact line and column, fix the flagged spot, and move on.
Use the free tool: Validate JSON — errors shown with line, column, and character position.
The 5 errors you'll see most
1. Trailing comma — a comma after the last item. JSON forbids it (JavaScript allows it, which is why it's so common).
{ "name": "Ada", "role": "dev", }
2. Missing comma — two values with nothing between them.
{ "name": "Ada" "role": "dev" }
3. Unquoted or single-quoted keys — keys must use double quotes.
{ name: "Ada" } // wrong
{ 'name': "Ada" } // wrong
{ "name": "Ada" } // right
4. Mismatched brackets — an opened [ closed with }, or a missing closer. Count your openers and closers.
5. Comments or undefined — // comments, /* */, undefined, and trailing text are not valid JSON, even if your editor tolerates them.
Steps to validate
-
Open the JSON Validator.
-
Paste your JSON into the editor.
-
Read the error: it reports line, column, and character position — e.g. "Line 4, Column 12".
-
Fix that exact spot (usually one of the five errors above) and re-paste until it validates.
-
Once valid, head to the JSON Formatter to pretty-print or minify it.
Troubleshooting
- Error position points at the end of the file? That usually means an unclosed bracket or quote earlier — the parser only noticed at the end. Check your openers.
- Copied from docs with smart quotes? Word processors turn
"into curly quotes, which JSON rejects. Retype them as straight quotes. - Huge minified blob? Validate first, then format — debugging one-line JSON by eye is miserable.
Next steps:
Frequently asked questions
Is the JSON validator free?
Yes — free and unlimited, with no account required.
Is my JSON data uploaded anywhere?
No. Validation runs entirely in your browser; your data never leaves your device.
What's the difference between the validator and the formatter?
The validator finds syntax errors with exact locations. The formatter pretty-prints, minifies, and sorts keys in valid JSON.
Why does my JSON fail with 'unexpected token'?
Usually a missing comma, an unquoted key, or a stray character. The validator pinpoints the exact line, column, and character position.