JSON Fixer & Repair Tool
Automatically detect and fix common JSON syntax errors. Paste broken JSON, get valid JSON back.
Paste broken JSON — trailing commas, single quotes, unquoted keys, comments, Python booleans — and get valid JSON back in one click. The fixer parses your input character by character, repairs 16+ error types automatically, and shows you exactly what changed with line numbers. And everything runs in your browser. Nothing gets uploaded.
How It Works
The parser walks through your input one character at a time, tracking bracket depth, quote state, and value context. When it hits something that isn't valid JSON — a trailing comma before a closing brace, single quotes around a string, a JavaScript comment block — it applies the smallest possible fix. Every repair gets logged with the line number so you can review exactly what changed before using the output.
Examples
Trailing Commas from a Config File
Someone edited a package.json by hand and left commas after the last items. Every JSON parser on earth rejects this.
{
"name": "my-app",
"version": "1.0.0",
"scripts": {
"build": "webpack",
"test": "jest",
},
}
{
"name": "my-app",
"version": "1.0.0",
"scripts": {
"build": "webpack",
"test": "jest"
}
}
Single Quotes and Unquoted Keys from JavaScript
You console.logged an object in the browser and pasted the output. JavaScript objects look like JSON but they aren't — keys have no quotes and strings use single quotes.
{
name: 'Alice',
age: 30,
active: true
}
{
"name": "Alice",
"age": 30,
"active": true
}
Python API Response with Comments and Non-JSON Values
A teammate dumped a Python dict into a shared doc. It has True/False/None instead of true/false/null, plus some inline comments they added for context. Classic mess.
{
"status": True,
"count": None,
// TODO: remove this later
"data": [1, 2, NaN],
"label": "test"
}
{
"status": true,
"count": null,
"data": [1, 2, null],
"label": "test"
}
Who Uses This
Fixing malformed API responses and config files that won't parse during debugging sessions.
Cleaning up exported JSON datasets that have trailing commas or inconsistent quoting before importing into tools.
Learning JSON syntax by seeing exactly which parts of their code are invalid and how to correct them.
Repairing hand-edited JSON configs for CI/CD pipelines and infrastructure-as-code templates.
Common Mistakes
JS objects with unquoted keys and single-quoted strings look similar but aren't valid JSON. The fixer will convert them, but know that you're converting — not just "fixing" — the format.
JSON doesn't support comments. Period. The fixer strips // and /* */ comments to produce valid output. If you need comments in your config, consider switching to JSONC or YAML instead.
The tool converts NaN, Infinity, and undefined to null — that changes meaning. Always review the fix report to make sure the replacements match what you intended. The Diff View button shows exactly what was altered.
Technical Details
- Processing: 100% client-side — no server upload, works offline
- Error Types Fixed: 16+ including trailing commas, single quotes, unquoted keys, comments, Python booleans, NaN/Infinity
- Browser Support: Chrome, Firefox, Safari, Edge
- File Size: Handles 100KB+ files efficiently in-browser
Frequently Asked Questions
What types of JSON errors can this tool fix?
It handles 16+ error types: trailing commas, missing commas between items, single quotes instead of double quotes, unquoted property names, unclosed brackets and braces, JavaScript comments (both // and /* */), Python-style True/False/None, NaN and Infinity values, semicolons used as separators, and unescaped control characters. Basically the stuff that makes JSON parsers choke.
Is my JSON data safe? Does it get sent anywhere?
Your data stays in your browser the entire time. There are zero server requests — the fixer runs as pure JavaScript on your machine. Nothing is stored, logged, or transmitted. It even works offline after the initial page load.
Can it handle large JSON files?
Yes. The parser processes files over 100KB without breaking a sweat. Since everything runs locally, there are no upload limits or server timeouts to worry about. Deeply nested structures work fine too.
What's the difference between Fix mode and Validate mode?
Fix mode repairs errors and gives you valid JSON output. Validate mode just tells you what's wrong without changing anything. Use Validate when you want to understand the problems first, then switch to Fix when you're ready to let the tool handle it.
Does fixing JSON change the meaning of my data?
For most fixes — no. Removing trailing commas, adding quotes to keys, swapping single for double quotes — these don't change your data at all. The exception is non-JSON values like NaN, Infinity, and undefined, which get converted to null because JSON has no way to represent them. Always check the fix report if your data uses those values.