JSON Repair
Repair broken JSON in your browser: close unclosed brackets, strip trailing commas, quote bare keys and convert single quotes.
Fix broken JSON: unclosed brackets, trailing commas, single quotes, bare keys and comments.
Repair report
Valid JSON after repair.
- Closed 1 unclosed bracket: }
- Removed 1 comment.
- Converted 3 single quoted strings to double quotes.
- Quoted 4 bare keys.
- Removed 1 trailing comma.
Repair guesses at intent. Always read the result before using it, especially when brackets were added, because there is more than one way to close a truncated payload.
{
"name": "Ada Lovelace",
"age": 36,
"skills": [
"JS",
"CSS"
],
"active": true
}About the json repair
Most broken JSON is not broken by much. It is a JavaScript object literal pasted where JSON was expected, a payload copied out of a log and truncated halfway, or a config file with comments in it. Every one of those is a small, mechanical fix.
This repairs by scanning character by character rather than with find and replace, because the whole difficulty is telling structure apart from the contents of a string, and a search cannot do that. A comma inside a quoted value must survive; the same comma before a closing brace must go.
How to use it
- 1Paste the broken JSON.
- 2Read the repair report to see exactly what was changed.
- 3Check the repaired output, especially if brackets were added.
- 4Copy the formatted or minified result.
Questions
Is my data sent anywhere?
No. The repair runs entirely in your browser, so you can paste a real API response or a config file safely.
Can it always fix my JSON?
No, and it tells you when it cannot. It handles the common cases: unclosed brackets, trailing commas, single quotes, bare keys, comments, and Python style True, False and None.
How does it close a truncated payload?
It tracks which brackets are still open and closes them innermost first. That is a guess at your intent, so read the result. A payload cut off mid array can legitimately be closed more than one way.
Why is my JSON invalid when it looks fine?
Usually a trailing comma before a closing brace, a single quote, an unquoted key, or a comment. All four are valid JavaScript and none of them are valid JSON.