Private / No Upload

Fix JSON trailing comma errors

JSON does not allow trailing commas after the final object property or array item. Remove the last comma, then format or validate again.

Runs in your browser

HappyFormatter tools process pasted snippets client-side for quick, privacy-first developer workflows.

No upload

HappyFormatter tools process pasted snippets client-side for quick, privacy-first developer workflows.

No account

HappyFormatter tools process pasted snippets client-side for quick, privacy-first developer workflows.

Fix steps

  1. 1 Find the comma before the closing brace or bracket.
  2. 2 Remove the comma if no property or item follows it.
  3. 3 Run the JSON formatter or viewer to validate the result.

Invalid JSON

The comma after the last property is invalid JSON.

{
  "name": "Ada",
}

Output

Unexpected token } in JSON

Fixed JSON

Remove the trailing comma after the last property.

{
  "name": "Ada"
}

Output

Valid JSON object

Related pages