Repair Invalid JSON Online: what it does
Copied JSON from a log, a chat message or a JavaScript object and now it will not parse? Paste it here and press Repair. The tool fixes common JSON syntax errors and shows the original next to the repaired text, with every inserted and removed character highlighted.
Repair runs in your browser, so the broken payload never leaves your device. When you are happy with the result, apply it to the input and carry on with the JSON formatter, tree view or graph view.
Syntax errors the JSON repair tool fixes
- Single quotes and unquoted keys converted to valid double-quoted JSON
- Trailing commas and missing commas
- JavaScript and Python literals such as None, True, False and undefined
- Comments (// and /* */) removed
- Truncated JSON with missing closing brackets, braces or quotes
- Green and red highlighting of every inserted and removed character
- Pretty printed result shown separately from the raw before/after diff
- Apply the repaired text back to the input in one click
How to repair broken JSON
- Paste the invalid JSON into the input box.
- Click Repair to see the repaired JSON and a highlighted list of changes.
- Review the diff, then click Apply to input to replace your text with the fixed JSON.
- Use Format, Tree or Graph to keep working with the repaired data.
Examples
Fix single quotes, unquoted keys and trailing commas
A JavaScript-style object is not valid JSON. Repair turns it into strict JSON.
{name: 'Ada', roles: ['admin', 'editor',], active: True,}Complete truncated JSON
Output cut off in the middle? Repair closes the open strings, arrays and objects.
{"user": {"id": 7, "tags": ["a", "b"Strip comments from JSON
JSON does not allow comments. Repair removes them and keeps the data.
{
// service settings
"port": 8080, /* default */
"debug": false
}Frequently asked questions
How do I fix invalid JSON?
Paste it into the input box and click Repair. The tool corrects common syntax errors such as single quotes, trailing commas, comments and missing brackets, then shows what it changed.
What does the Repair button actually change?
It changes only what is needed to make the text valid JSON. Inserted characters are highlighted in green and removed characters in red, so you can check every change before applying it.
Why is my JSON invalid?
The most common causes are single quotes instead of double quotes, trailing commas, unquoted keys, comments, and text that was cut off. The validator reports the line and column of the first syntax error.
Is my broken JSON sent to a server?
No. Repair runs entirely in your browser, so confidential payloads stay on your device.