Fix Invalid JSON
Diagnose your JSON error and find the fix.
100% local — your data never leaves this tab
Auto-fix repairs trailing commas, comments, single quotes, unquoted keys, smart quotes, Python-style True/False/None and simple missing commas. Always review the result. See also the 10 most common JSON errors.
Input JSON0 bytes
Output0 bytes
How to fix the most common JSON errors
Trailing comma
// Broken
{"name": "Alice", "age": 30,}
^-- remove this
// Fixed
{"name": "Alice", "age": 30}
Single quotes instead of double quotes
// Broken
{'name': 'Alice'}
// Fixed
{"name": "Alice"}
Unquoted key
// Broken
{name: "Alice"}
// Fixed
{"name": "Alice"}
Comment inside JSON
// Broken
{
"name": "Alice", // the user's name
"age": 30
}
// Fixed — remove the comment entirely
{
"name": "Alice",
"age": 30
}
Missing comma between items
// Broken
{"name": "Alice"
"age": 30}
// Fixed
{"name": "Alice",
"age": 30}
Quick method: Paste your broken JSON into the input box above. The validator shows the exact error and character position. Fix the issue in the input, and the status turns green when the JSON is valid.
Frequently asked questions
Find the last item in the object or array and remove the comma that follows it. In most code editors, you can search for ,} or ,] to find trailing commas quickly.
Simple find-and-replace works for most cases, but be careful not to replace single quotes that appear inside string values (e.g. apostrophes in names like "O'Brien"). In that case, manually replace the outer quotes only.