How to fix trailing commas in JSON on Mac
To fix trailing commas in JSON, remove a comma when it is the last separator before a closing brace or bracket. Keep commas between members or array values, and keep commas inside quoted strings. Preserve the original, edit a copy, then validate it. JSON Editor & Diff on Mac also documents repair for trailing commas and comments.

Find the comma that has nothing after it
A comma separates one object member from the next, or one array value from the next. If the next meaningful character is a closing brace or bracket, there is no next member or value. That final separator does not belong in standard JSON.
For a small object, the invalid text {"enabled": true,} becomes {"enabled": true}. The closing brace ends the object; removing the comma leaves the enabled value unchanged. This is different from removing the comma between two existing members.
Check each level of a nested example
Use this fictional input: {"tags": ["red", "blue",], "label": "red, blue",}. There are two trailing commas: one after the blue array value, and another after the label member. The comma separating the tags and label members is necessary.
The corrected text is {"tags": ["red", "blue"], "label": "red, blue"}. The comma inside the label string remains part of that text. Removing every comma would damage both the structure and the intended label.
- Keep a copy of the original input.
- Find each closing brace and bracket, including nested ones.
- Remove only a preceding separator that has no following member or value.
- Validate the edited copy and compare its values with the original intent.
Use validation and Repair in JSON Editor & Diff
JSON Editor & Diff provides live validation in its Source and Destination editors. Its released repair capability covers comments and trailing commas. Keep the original file separately before opening, pasting or repairing content so that any normalized result can be reviewed against it.
For a small, understood mistake, a manual edit makes the change easier to inspect. If you use Repair, review the whole result rather than assuming the operation removed only the one comma you noticed. A successful parse says the result is syntactically acceptable; it does not establish the intended settings or an API contract.
If the edited JSON still fails validation
Check the other nesting levels before making broader changes. An outer object may be fixed while an inner array still ends with a comma. If the final separator is correct, inspect the reported location and its surroundings for another issue, such as an unclosed quote or a missing separator between values.
If removing one comma leaves uncertainty about the intended data, return to the source that produced it. Save the corrected copy under a distinguishable name and use it only after checking the values that matter to your task.
Questions
Should I remove the comma in a value such as "red, blue"?
No. Inside a quoted string, that comma is text. It is different from the separators between object members or array values.
Can a nested array still have a trailing comma after I fix the outer object?
Yes. Check each closing brace and bracket independently, then validate the complete document.
Does Repair prove that my configuration is correct?
No. It can help produce valid JSON, but the intended values and any receiving application’s rules still need review.