Skip to main content

Fix JSON Trailing Comma Error (Expected double-quoted property)

Easily fix the trailing comma JSON parse error. Understand why JSON forbids trailing commas and resolve "Expected property name" stack traces.

Back to Tools
SyntaxError: Expected double-quoted property name in JSON at position...

In JavaScript objects, trailing commas are perfectly legal. However, the JSON standard (RFC 8259) strictly forbids trailing commas after the last element in an array or the last property in an object.

Common Causes

  • Copy-pasting JavaScript object literals into a JSON file.
  • Hand-editing JSON files and deleting the last item without removing the previous comma.
  • Generating JSON via imperfect string concatenation instead of a native serializer.

What Triggers It

{
  "name": "Alex",
  "role": "Admin",
}

How to Fix It

{
  "name": "Alex",
  "role": "Admin"
}

The Solution

You must remove the comma that precedes the closing `}` or `]`. You can do this manually, or run your code through our online JSON Fixer which automatically resolves trailing comma issues.

Fix Your JSON Automatically

Paste your broken JSON code into our free online tool to repair syntax errors instantly.