JSONRepair

Fix Invalid JSON

Paste broken JSON on the left, press Fix JSON, and get valid, parseable JSON on the right. The tool automatically repairs trailing commas, single quotes, comments, unquoted keys, smart quotes and more, and tells you exactly what it changed in plain English.

    Why does JSON break?

    JSON looks a lot like a JavaScript object, but it is far stricter. The most common reasons pasted text fails to parse are:

    Formatters and validators only tell you where the error is. This tool goes further and repairs the damage for you.

    Frequently asked questions

    What kinds of broken JSON can this tool fix?

    It repairs trailing commas, single-quoted strings and keys, // and /* */ comments, unquoted object keys, smart/curly quotes, raw line breaks inside strings, leading zeros (007), missing leading zeros (.99), invalid values like undefined, NaN and Infinity (converted to null), and unclosed brackets from truncated input. After repairing, it verifies the result with a real JSON parse.

    Is my data sent to a server?

    No. Everything runs 100% client-side in your browser using plain JavaScript. Pasted JSON never leaves your device, there is no account, no upload and no tracking of your content.

    What if my JSON cannot be repaired?

    Some damage is beyond automatic repair, for example a string cut off mid-word with no recoverable structure, or two values with a missing comma between them. In that case the tool shows the exact parser error message so you know precisely what to fix by hand.

    Does it handle JSON with comments (JSONC)?

    Yes. Both single-line // comments and multi-line /* */ comments are stripped before parsing, as long as they appear outside of string values. URLs inside strings are left untouched.

    Can I get the output minified instead of pretty-printed?

    Yes. After a successful repair, use the Minify toggle above the output to switch between human-readable (2-space indent) and compact single-line JSON. The Copy button copies whichever view is active.

    COMING SOON

    Pro features

    API access and batch mode for repairing thousands of JSON documents at once are on the roadmap. The free web tool above will always stay free.

    Privacy note

    This page contains no trackers on your pasted content and makes zero network requests for the repair itself. Your JSON is processed entirely in your browser and never leaves this device.

    Guides

    Read our JSON guides

    Why Is My JSON Invalid? The 7 Syntax Errors That Break JSON.parse
    Trailing commas, single quotes, smart quotes, comments, and the other repeat offenders, with before-and-after examples for each.

    JSON with Comments (JSONC): What It Is and How to Handle It
    Where JSONC is safe, where it breaks parsers, and how to strip comments without a regex destroying your URLs.