Trailing commas in JSON, explained
Why every parser rejects them, when JSON5/JSONC do allow them, and how to clean them up.
A trailing comma is the comma after the last element of an array or object:
{ "a": 1, "b": 2, } // trailing comma after 2RFC 8259 forbids it. Every compliant parser rejects it. JavaScript and Python allow it in their literal syntax — that's where the muscle memory comes from.
Quick fix
Remove the comma before each ] and }. The JSON FYI linter highlights every offender with line and column.
If you really want them
Use JSON5 or JSONC, both of which accept trailing commas. Pick one and configure your parser accordingly.
Find the problem with the JSON linter →
The linter surfaces trailing commas, duplicate keys, and other common issues with line and column numbers.
Open JSON Linter →