JSON Repair
One-click repair of broken JSON — single quotes, unquoted keys, trailing commas, // and /* */ comments, smart quotes and truncation become valid JSON, with precise locations when unfixable.
>_ USAGE GUIDE
LLM output, API logs and config files often contain "almost valid" JSON: unquoted keys, single-quoted strings, extra trailing commas, // comments, even truncated text. This tool repairs each class with toggles and returns parseable JSON.
Typical steps:
- Paste the broken JSON: drop the text in, all four repair toggles are on by default
- Toggle each step: quote normalization (single-quoted strings and unquoted keys to double quotes, smart quotes straightened), trailing-comma stripping, comment stripping, truncation completion — turn any off as needed
- Inspect the result: valid JSON appears on the right; open "repaired structure tree" to browse the hierarchy and confirm nothing was altered
- Locate failures: if still unfixable, the result turns red and shows the exact "line N · col M" so you jump straight to the source
>_ FAQ
Q1 · Are single-quoted strings converted correctly?
Yes. Only single quotes acting as string delimiters become double quotes; an apostrophe inside a string (e.g. "don't") is preserved, so English contractions are never broken.
Q2 · Are unquoted keys quoted automatically?
Yes. A bare key like { name: "x" } becomes "name", while a , key: shape inside a string value is not misidentified as a key, reducing false edits.
Q3 · How is truncated JSON completed?
With "complete truncation" on, the tool first closes an unfinished string, then closes unclosed { and [ in stack order. It is best-effort — deeply nested or mid-critical cuts may still need a manual fix.
Q4 · Why does it fail after I turn a toggle off?
Each toggle maps to one repair class. Turning off "comment stripping" leaves // in the text (parse error); turning off "trailing-comma stripping" leaves the extra comma. Toggling off is for diagnosing which issue exists — keep all on for the final fix.
Q5 · Does repair change my data?
No. Repair only fixes the syntactic shell (quotes, commas, comments, unclosed brackets); field names and values are untouched — verify with the structure tree.