What a Trailing Comma Looks Like
{
"name": "Ava",
"age": 30,
}The comma after 30 is invalid in JSON.
Why It Happens
- Manual edits in configs or sample payloads.
- Copy/paste from JavaScript object literals (which allow trailing commas).
- Templating logic that always appends commas.
Fix Workflow
- Validate in JSON Validator to locate the error position.
- Format with JSON Formatter to expose the line break.
- Remove trailing commas and re-validate.
Safe Example
{
"name": "Ava",
"age": 30
}FAQ
Why does JavaScript accept trailing commas but JSON does not?
JSON is a strict data interchange format; it does not allow trailing commas by specification.
Can the formatter auto-fix this?
No. The formatter requires valid JSON. Fix commas first, then format.