Paste broken JSON with trailing commas, single quotes, comments, or unquoted keys and get valid, pretty-printed JSON back — plus a note listing everything that was repaired.
What is the Fix JSON Online?
Fix JSON online is for the JSON that almost works: config snippets copied from documentation, JavaScript object literals pasted from source code, or API drafts typed by hand. Strict parsers reject them over small sins — a trailing comma here, single quotes there, a helpful comment somewhere in the middle. This tool repairs those common mistakes automatically and returns valid, pretty-printed JSON.
It fixes five frequent problems: trailing commas before closing brackets, single-quoted strings and keys converted to double quotes, unquoted keys like {name: …} wrapped in quotes, // line comments and /* block comments */ stripped out, and it reports every repair it made so nothing happens silently. Repairs are applied outside string values only, so text inside your quotes is never touched.
After repairing, the result is validated with a strict parser and pretty-printed with your chosen indentation. If the input is damaged beyond these automatic repairs — unbalanced brackets, truncated data — you get a clear error instead of a guess. As always, everything runs locally in your browser: no signup, no upload, no trace of your data left behind.
One more reason to keep this fixer bookmarked: it is deliberately conservative. It never invents missing brackets, never reorders keys, and never guesses at truncated values — if the structure cannot be salvaged by the documented repairs, you get an honest error instead of silently corrupted data. That makes it safe to run on payloads you are about to send to production systems.
How to use the Fix JSON Online
- Paste the broken or nearly-valid JSON into the input box.
- Choose your preferred indentation for the repaired output.
- Click Fix JSON to apply all automatic repairs and pretty-print the result.
- Read the repair note above the output — it lists exactly what was fixed (trailing commas, quotes, comments, keys).
- Copy or download the valid JSON. If an error remains, the message tells you what the fixer could not repair.
Fix JSON Online use cases
Converting JS object literals
Stack Overflow answers and docs often show JavaScript object literals with single quotes and trailing commas. Paste them here to convert the snippet into strict, valid JSON you can actually parse.
Cleaning hand-written configs
Hand-typed JSON configs accumulate comments and trailing commas. Run the draft through the fixer to strip the comments and normalize the syntax before it reaches your build pipeline.
Salvaging copied payloads
JSON copied from chat apps, PDFs, or rendered web pages picks up smart quotes and stray formatting. The fixer normalizes the common cases so you do not have to hunt character by character.
Preparing API test bodies
When drafting request bodies quickly, it is easy to leave a trailing comma or forget quotes on a key. Fix it in one click instead of round-tripping through an editor’s linter.
Tips
- Always read the repair note — it tells you what changed, which helps you fix the source so the problem does not recur.
- The fixer never alters text inside string values; only structural syntax outside quotes is repaired.
- If fixing fails, the most likely cause is unbalanced brackets or truncated input — count your opening and closing braces.
- For JSON that is already valid, use the JSON Formatter instead — the fixer is for broken input.