JSON Fixer
Paste broken or invalid JSON and get it fixed in one click. The fixer automatically repairs the most common JSON mistakes — trailing commas, single quotes, bare keys, Python literals, and JS comments.
Last updated: May 21, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is JSON Fixer?
JSON is strict about syntax: no trailing commas, no single quotes, no comments, no unquoted keys. But JSON is often hand-written, copy-pasted from code, or generated by tools that produce slightly non-standard output. The result is JSON that fails to parse and produces cryptic "Unexpected token" errors.
This tool automatically detects and repairs the most common JSON issues: trailing commas before closing braces or brackets, strings wrapped in single quotes instead of double quotes, bare object keys without quotes, Python-style True/False/None literals, JavaScript undefined values, and JS-style single-line or block comments. It shows you exactly what was fixed so you know what changed.
How to Use JSON Fixer
Paste broken or invalid JSON into the input area or click "Load Sample"
The fixer runs automatically and shows the fixed JSON on the right
A fix log appears below listing every correction made
If the JSON could not be fully repaired, the error message tells you what still needs fixing
Copy or download the fixed JSON output
Common Use Cases
- Developers fixing JSON copy-pasted from JavaScript source code that has trailing commas or comments.
- Python developers fixing JSON that was logged or printed with Python repr (True/False/None instead of true/false/null).
- API engineers cleaning up JSON responses from tools that produce non-standard output.
- Front-end developers fixing hand-written JSON config files with missing quotes or trailing commas.
- Data engineers repairing JSON data files before loading them into databases or parsers.
- Developers debugging API payloads that fail with "Unexpected token" errors.
Example Input and Output
A JSON object with single quotes, trailing commas, bare keys, and a JS comment is automatically fixed to valid JSON.
{
// server config
host: 'localhost',
port: 8080,
debug: True,
tags: ['api', 'v2',],
}{
"host": "localhost",
"port": 8080,
"debug": true,
"tags": ["api", "v2"]
}Privacy
All fixing runs in your browser. No data is uploaded to any server.
Fix order matters
Fixes are applied in sequence: comments first, then Python literals, single quotes, bare keys, trailing commas, missing commas. The fixer stops as soon as the result is valid — so it only applies the minimum fixes needed.

