JSON Repair

FreePrivateHeuristic

Paste almost-JSON: trailing commas, single quotes, unquoted keys, comments, or undefined. The tool produces strict JSON you can parse anywhere.

Broken / lenient JSON
Repaired JSON
Ctrl+Enter Repair

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

Missing comma
{ "a": 1 "b": 2 }
{ "a": 1, "b": 2 }
Trailing comma
{ "a": 1, "b": 2, }
{ "a": 1, "b": 2 }
Unquoted keys
{ name: "Alice" }
{ "name": "Alice" }
Single quotes
{ 'name': 'Alice' }
{ "name": "Alice" }

How to Fix JSON Errors

  1. Paste your broken JSON into the input panel above
  2. Click Format. The error message shows the exact line and column
  3. Find the line in your JSON and apply the fix from the examples above
  4. 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 key
  • Unexpected end of JSON input. unclosed brace { or bracket [
  • Expected property name. key not in double quotes, or trailing comma
  • Expected double-quoted property name. used single quotes instead of double
  • SyntaxError: 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