JSON Fixer
Auto-repair malformed JSON — single quotes, trailing commas, JS comments, undefined, and Python literals.
What This Tool Fixes
| Problem | Input | Fixed Output |
|---|---|---|
| Trailing commas | {"a": 1,} | {"a": 1} |
| Single quotes | {'a': 'b'} | {"a": "b"} |
| undefined values | {"x": undefined} | {"x": null} |
| Python None | {"val": None} | {"val": null} |
| Python True/False | {"ok": True} | {"ok": true} |
| JS // comments | // title {"a": 1} | {"a": 1} |
| JS /* */ comments | /* note */ {"a": 1} | {"a": 1} |
| BOM character | {"a": 1} | {"a": 1} |
Limitations
The fixer handles common patterns but cannot repair all malformed JSON. If the output still fails to parse, use the JSON Validator to see the exact error location and fix it manually.
Complex cases not handled: deeply escaped strings, hex escape sequences, multi-line string values, or truncated/incomplete JSON.
Common JSON Errors and Their Fixes
json
// Before fixing (JavaScript object literal, not valid JSON):
{
// User profile
name: 'Alice', // unquoted key, single quotes
active: True, // Python boolean
score: undefined, // JS undefined
tags: ['a', 'b',], // trailing comma
}
// After fixing:
{
"name": "Alice",
"active": true,
"score": null,
"tags": ["a", "b"]
}