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:
- Trailing commas after the last item in an object or array, usually left behind when a line is deleted.
- Single quotes around strings or keys, which are valid in JavaScript but not in JSON.
- Comments (
//or/* */), copied from config files or code samples. Standard JSON has no comments. - Unquoted keys like
{ name: "Ada" }instead of{ "name": "Ada" }. - Smart quotes pasted from Word, Google Docs, emails or chat apps, which look like quotes but are different characters.
- Truncated output from APIs or AI models that cut off mid-response, leaving brackets unclosed.
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.
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.