How to Fix Invalid JSON

Repair common JSON syntax errors and validate your data.

Invalid JSON usually comes from a small syntax problem: a trailing comma, a missing comma, a single quote, an unquoted key, a comment, or a mismatched bracket. The fastest workflow is to paste the JSON into a validator, read the first error location, and fix errors one by one.

Common Invalid JSON Patterns

Trailing comma

{
  "name": "Ava",
  "active": true,
}

Remove the comma after the final property.

Single quotes

{'name': 'Ava'}

JSON strings and object keys must use double quotes.

Unquoted keys

{name: "Ava", active: true}

JSON object keys must be quoted: {"name": "Ava"}.

Comments inside JSON

{
  // owner name
  "name": "Ava"
}

JSON does not support comments. Remove them before parsing.

How to Fix Invalid JSON with JSON Formatter Hub

  1. Paste your JSON into the JSON Formatter.
  2. Click Format to validate and locate syntax errors.
  3. Click Auto-fix for common issues such as trailing commas, comments, single quotes, and unquoted keys.
  4. Review the result and click Format again to confirm it is valid.
  5. Use Remove Whitespace or Export/Download when the JSON is clean.

When Auto-fix Cannot Repair It

Auto-fix can repair many simple mistakes, but it cannot safely guess missing values, broken nesting, or incomplete copied text. If the JSON is cut off, copy the original response again. If the payload is deeply nested, use the line and character position from the validation error to inspect the first broken area.

Need to repair a payload? Paste invalid JSON and use Format or Auto-fix.

Fix JSON Now