JSON Repair
Paste almost-JSON: trailing commas, single quotes, unquoted keys, comments, or undefined. The tool produces strict JSON you can parse anywhere.
Fix Invalid JSON Online
Got a SyntaxError: Unexpected token or JSON parse error? Paste your broken JSON above and the validator will point you to the exact line and column of every error. so you can fix it in seconds.
Why JSON Becomes Invalid
{ "a": 1 "b": 2 }{ "a": 1, "b": 2 }{ "a": 1, "b": 2, }{ "a": 1, "b": 2 }{ name: "Alice" }{ "name": "Alice" }{ 'name': 'Alice' }{ "name": "Alice" }How to Fix JSON Errors
- Paste your broken JSON into the input panel above
- Click Format. The error message shows the exact line and column
- Find the line in your JSON and apply the fix from the examples above
- Click Format again: valid JSON will be formatted and highlighted green
Common Error Messages Explained
Unexpected token. usually a missing or extra comma, or an unquoted keyUnexpected end of JSON input. unclosed brace{or bracket[Expected property name. key not in double quotes, or trailing commaExpected double-quoted property name. used single quotes instead of doubleSyntaxError: JSON.parse. generic parse failure; check the character position shown
Frequently Asked Questions
Why does JSON show a parse error?
JSON parse errors happen when syntax is invalid: most commonly a missing comma, a trailing comma after the last item, unquoted keys, or single quotes instead of double quotes.
How do I find the exact error location?
Paste your JSON into the formatter above and click Format. The error message shows the exact line and column number so you can jump straight to the problem.
What is the most common JSON error?
A missing comma between object properties. e.g. {"a": 1 "b": 2}. is the most frequent cause of JSON parse errors.
Related Tools