Trailing commas are not allowed in JSON

JSON forbids a comma after the last item of an object or array, even though JavaScript allows it. Here is why, and how to find and remove them.

Open the JSON formatter

What the error looks like

Different engines word this differently. You may see any of these:

Why it happens

Example

Invalid
{
  "name": "John",
  "age": 30,
}
Valid
{
  "name": "John",
  "age": 30
}

How this tool reports it

The formatter points at the comma itself rather than the bracket after it, and offers Remove comma as a one-click fix.

Paste your JSON into the formatter to see the exact line and column, or use the validator if you only need to check it.

Worth knowing