Fix JSON Online

Quick answer: Fix JSON Online is a free online tool that lets you 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. Free with no signup or download: get results instantly, all inside your browser.

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

  1. Paste the broken or nearly-valid JSON into the input box.
  2. Choose your preferred indentation for the repaired output.
  3. Click Fix JSON to apply all automatic repairs and pretty-print the result.
  4. Read the repair note above the output — it lists exactly what was fixed (trailing commas, quotes, comments, keys).
  5. 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.

Frequently asked questions

What exactly does the JSON fixer repair?
Five common problems: trailing commas before } or ], single-quoted strings and keys converted to double quotes, unquoted keys wrapped in quotes, // line comments removed, and /* block */ comments removed. It then validates and pretty-prints the result. Repairs apply only outside quoted strings, so your actual data values are never modified — only the structural syntax around them.
Will it change the text inside my strings?
No. All repairs are applied only to structural syntax outside quoted string values. The content of your strings — including any commas, quotes, or comment-like text inside them — is left untouched. This guarantee is what makes the fixer safe to run on payloads containing code samples, regex patterns, or documentation with comment-like text.
What if my JSON is too broken to fix?
You get a clear error message instead of a corrupted guess. Typical unfixable cases are unbalanced brackets, truncated input, or smart/curly quotes pasted from rich text. Fix the reported issue and try again. In that case, fix the reported structural issue first — usually a missing brace — then run the fixer again for the smaller problems.
Does it tell me what was fixed?
Yes. A repair note lists every category of fix applied — for example 'removed 2 trailing commas; converted 3 single-quoted strings'. Nothing is changed silently. Use the note to fix the source that produced the broken JSON, so you stop needing the fixer for the same mistake.
Is my data sent to a server?
No. The repair runs entirely in your browser with local JavaScript. Nothing is uploaded, stored, or logged. You can verify this yourself: open your browser's network tab, run the fixer, and watch — zero requests are made. That is the strongest privacy guarantee a web tool can offer.
Can it fix JSON with comments?
Yes — both // line comments and /* block comments */ are stripped, as long as they appear outside string values. This is handy for configs that were documented inline. Comment-like text inside quoted string values is left alone, so only genuine comments outside strings are removed.
How is this different from the JSON Formatter?
The Formatter requires valid JSON and rejects anything else with an error. The Fixer accepts nearly-valid JSON, repairs common mistakes automatically, and then formats the result. A good workflow is Fixer first for messy drafts, then Formatter for everyday pretty-printing once your JSON is valid.
Does the fixer work on minified single-line JSON?
Yes. Comments are stripped and trailing commas removed whether the JSON spans one line or one hundred. After repairs, the output is pretty-printed with your chosen indentation, so even minified input comes back readable and ready to inspect. Line comments in single-line input run to the end of the input, so keep that in mind — anything after // on the only line is treated as a comment.