JSON Repair
Fix broken JSON, and see every change before you use it.
Runs in your browser
Output will sizzle here.
Why JSON breaks, and how this fixes it
JSON is strict: one trailing comma, a comment, single quotes or a Python True and every parser rejects it. That JSON usually comes from config files written by hand, JavaScript objects, Python output, logs cut off halfway, or an API response wrapped in a JSONP callback.
Paste it here and the repaired version appears beside it, with every change marked: green for what was added or changed, red for what was removed. A summary lists what was wrong. Your input stays exactly as it is until you choose to use the repaired JSON, and numbers keep every digit.
How to use the JSON Repair
Paste the broken JSON. Or load the sample to see the kinds of problems it fixes.
Check the changes. The summary above lists the fixes, and the Repaired box marks each change in place.
Use the repaired JSON. It replaces your input, or copy it straight away.
Carry on. Once it's valid, the Next buttons open it in the JSON Formatter, the converter, the Diff Checker and more.
Tips
- Repair can guess wrong when the JSON is badly damaged, for example a value that was cut off. Always check the marked changes before you rely on the result.
- Comments are removed, because JSON doesn't allow them. If you need comments, keep the original as JSONC or JSON5 and repair a copy.
NaNhas no JSON equivalent, so it becomes the string"NaN";undefinedbecomesnull.
Frequently asked questions
What can it fix?
Trailing commas, missing commas, single or curly quotes, unquoted keys, comments, Python True/False/None, NaN and undefined, unclosed brackets, JSONP wrappers like callback({...}), and Markdown code fences around JSON.
Will it change my numbers?
No. The repair works on the text itself, so a number like 12345678901234567890 keeps every digit instead of being rounded.
What if it can't repair my JSON?
It says so and points to the line and column where it got stuck. That usually means a value or bracket is missing in a way that can't be guessed safely.
Is my JSON uploaded?
No. Repairing and comparing happen entirely in your browser.