Input
Waiting for input
1
Output
1
Strip every illegal trailing comma from your JSON in one click — keeps the rest of your structure untouched and works fully in the browser.
Runs entirely in your browser — no upload, no wait.
Your JSON never leaves the tab. Nothing is logged.
Free, unlimited, no account required.
JavaScript objects allow trailing commas. JSON does not. The official RFC 8259 spec forbids a comma after the final element of an array or object, which is why JSON.parse throws "Unexpected token } in JSON at position N" the moment one slips in.
IDE auto-formatters and AI code generators love to leave them behind. The fix is mechanical: walk the document, find every comma followed only by whitespace and a closing bracket, and delete it. That is exactly what this tool does.
Paste your broken JSON into the editor on the left. The Smart Auto-Repair engine detects trailing commas alongside other common mistakes (unquoted keys, single quotes, comments) and patches them in place. The output panel shows clean, RFC-compliant JSON ready to copy into your code or API request.
If you only want to remove trailing commas without touching anything else, switch off "aggressive repair" in settings. The tool will then do exactly one thing: remove illegal terminal commas.
// Before
{
"items": [1, 2, 3,],
"active": true,
}
// After
{
"items": [1, 2, 3],
"active": true
}For one-off edits, the browser tool is fastest. For CI pipelines or batch fixes across many files, a small script does the same job.
# Node one-liner — strips trailing commas before JSON.parse
node -e "const fs=require('fs'); const f=process.argv[1]; const s=fs.readFileSync(f,'utf8').replace(/,(\s*[}\]])/g,'$1'); fs.writeFileSync(f, s);" broken.jsonJSON5 and JSONC (used by VS Code settings, tsconfig.json, and many config files) explicitly allow trailing commas and comments. If your "JSON" is really JSONC, the right fix is to load it with a JSONC parser instead of stripping commas. Strict JSON consumers — REST APIs, message queues, schema validators — always reject them.
Everything runs in your browser. The JSON never leaves your machine, never hits a server, and there is no upload step. Files up to ~10 MB process instantly; larger files stream through the same in-memory pipeline.