Repair broken JSON
Paste JSON that will not parse, from a config file, a log, a Python print or an AI answer, and get valid JSON back. Every fix is listed, so you know what changed.
How to use the JSON repair tool
- Paste the broken JSON or drop the file on the editor.
- Valid, formatted JSON appears on the right.
- Read the list of fixes under the editors to check what was changed.
- Copy or download the repaired JSON.
What you get
- Comments removed: // line, /* block */ and # comments
- Trailing commas removed and missing commas added
- Single quotes and unquoted keys turned into double quotes
- Python True, False and None, and NaN or undefined, made valid
About the JSON repair tool
Where broken JSON comes from
Hand-edited config files with comments, JavaScript objects pasted from code, Python dictionaries printed to a log, JSON Lines files and answers from AI chat tools are the usual suspects. Repair handles all of them.
Transparent fixes
The repair never guesses silently. Each kind of fix it applied is listed, and if the input is too damaged to repair you get the line and column where it got stuck.
Several values at once
If you paste several JSON objects one after another, as in JSON Lines, they are wrapped in an array so you get one valid document.
Frequently asked questions
- Will repair change my data?
- Only the syntax. Values stay the same, except that Python None, undefined and NaN become null because JSON has no equivalent.
- Can it fix any broken JSON?
- It fixes the common mistakes. Text that is cut off in the middle, or plain words without quotes as values, still needs a manual fix, and the error tells you where.
- Is it the same as a JSON5 parser?
- It accepts most JSON5 features, such as comments, trailing commas, single quotes and unquoted keys, and writes standard JSON.