Repair · Clean · Recover
Fix JSON Errors
Updated: June 2026
Most "invalid JSON" is not random corruption — it is JSON written with conveniences that the strict spec forbids: trailing commas, comments, single quotes, unquoted keys. A repair tool detects and removes those so the data becomes valid again, without you hunting through it character by character.
Free · No upload · Instant in the browser
The four mistakes that break JSON
The overwhelming majority of parse failures come from a short list of habits carried over from JavaScript or other languages:
- Trailing commas — a comma after the last item, like
[1, 2, 3,]. Legal in JavaScript arrays, illegal in JSON. - Comments —
//and/* */notes that JSON simply does not allow. - Single quotes —
'value'instead of"value". JSON strings must use double quotes. - Unquoted keys —
{name: "x"}instead of{"name": "x"}. Object keys must be quoted strings.
Enable Repair and the tool fixes all four automatically, then re-formats the cleaned, strictly-valid JSON.
How the repair works
The repairer makes a careful, string-aware pass over your text. It removes line and block comments without touching // sequences that happen to live inside a string value such as a URL. It converts single-quoted strings to double quotes while escaping any embedded quotes correctly. It adds quotes around bare object keys, and it deletes commas that sit just before a closing brace or bracket. Only after those fixes does it hand the result to a strict parser, so what you get back is guaranteed-valid JSON.
When repair can't help
Repair handles syntax conveniences, not genuinely broken structure. If a string is left unterminated, a brace is missing entirely, or two values sit side by side with no separator and no clear intent, there is no safe automatic fix — guessing could silently change your data. In those cases the validator's line-and-column error is your tool: it pinpoints where the structure goes wrong so you can correct it by hand. Repair is for the predictable, mechanical mistakes; the error locator is for everything else.
Safe because it's local
Broken JSON is often something you pasted out of a log, a config or a half-finished API integration — exactly the material that may contain secrets. This repair tool runs in your browser, so none of it is uploaded. You can fix a malformed token payload or a leaked-looking config without sending it anywhere. The repaired, valid JSON appears instantly on the page, ready to copy back into your code.
Frequently asked questions
How do I fix invalid JSON?
Paste it and enable Repair. The tool removes trailing commas and comments, quotes bare keys and converts single quotes, then outputs valid JSON.
Can it remove trailing commas?
Yes. Repair strips commas that appear right before a closing brace or bracket, which is one of the most common causes of JSON errors.
Does repair ever change my data?
It only fixes syntax — comments, quotes, stray commas and unquoted keys. It will not invent values. Structurally broken JSON is flagged by the validator instead.
Is repair done privately?
Yes. It runs locally in your browser, so even broken JSON containing secrets is never uploaded.