JSON error reference

Trailing comma in JSON

Strict JSON does not allow a comma after the final property or array item.

01

Why it happens

  • A comma remains before a closing brace
  • A comma remains before a closing bracket
  • The content was copied from a JavaScript object literal
02

Guide

Invalid
{
  "active": true,
}
Valid
{
  "active": true
}
03

Common parser messages

Unexpected token }Expected double-quoted property nameProperty name expected
04

How to fix it

  1. 1

    Locate the closing brace or bracket near the parser position.

  2. 2

    Remove only the final comma.

  3. 3

    Check nested arrays and objects for the same pattern.

  4. 4

    Format the result after validation.

Jump to tool

Open broken example in JSON Repair

JSON Repair Tool