jsontoolskit.org
JSON and JSON Schema utilities, in the browser
Say hi →

JSON Repair — Fix LLM-Mangled JSON

trailing commas · single quotes · unquoted keys · smart quotes · JS comments · BOM

Paste broken JSON (or paste an LLM response that contains JSON mixed with prose — the tool extracts the JSON block). The right panel shows the repaired output and a change log lists every fix applied. Best-effort: for truly mangled output (truncated mid-token, mixed encodings), some recoveries fail.

Paste JSON to repair.

Change log

    How to repair JSON

    1. Paste broken JSON (or paste an LLM response that contains JSON mixed with prose — the tool extracts the JSON block).
    2. The right panel shows the repaired output. A change log below lists every fix applied ("removed trailing comma on line 12", "wrapped unquoted key name in quotes").
    3. If the repair confidence is low, the banner says Best-effort repair — review before using.
    4. Copy the result, or Format to jump straight to json-formatter with the cleaned output.

    What it fixes

    FAQ

    Why is this a "best effort"?

    Some breakage is unrecoverable — for example, a truncated string with a missing closing quote, or a number formatted as "1,234" where the comma is the thousands separator. The change log shows what was fixed; if the result still doesn't parse, you'll need to fix the rest manually.

    Will it handle JSON5?

    Mostly — JSON5 (comments, trailing commas, unquoted keys, single quotes) is a superset of what this tool fixes. Hex numbers and explicit + signs aren't supported.

    Why did my LLM output extract incorrectly?

    If your LLM put multiple JSON snippets in one response (e.g. two code fences), the tool grabs the first object/array span only. Split the response by hand before pasting.

    Will it work offline?

    Yes — after the page loads. The repair runs locally on your browser.