How to Fix Invalid JSON
JSON Formatter & Validator
Paste your broken JSON — errors are highlighted with the exact line number. Free and instant.
Open JSON Formatter & Validator →Find JSON errors instantly
Before manually hunting through your JSON, paste it into the JSON validator on tinybench.dev. It highlights the exact line and position of every syntax error — saving you from scrolling through hundreds of lines looking for a missing comma.
Error: Trailing comma
The most common JSON error. JSON does not allow a comma after the last item in an object or array.
{
"name": "Ada",
"age": 36,
}{
"name": "Ada",
"age": 36
}Error: Unquoted keys
JavaScript allows unquoted object keys, but JSON requires all keys to be double-quoted strings.
{ name: "Ada", age: 36 }{ "name": "Ada", "age": 36 }Error: Single quotes
JSON strings must use double quotes. Single quotes are invalid.
{ 'name': 'Ada Lovelace' }{ "name": "Ada Lovelace" }Error: Missing comma
Each property except the last must be followed by a comma.
{
"name": "Ada"
"age": 36
}{
"name": "Ada",
"age": 36
}Error: Comments in JSON
JSON does not support comments. Neither // nor /* */ are valid.
{
"debug": true // remove this in production
}{
"debug": true
}Error: Unescaped special characters in strings
Quotes, backslashes, and control characters inside strings must be escaped.
{ "message": "He said "Hello" to her" }{ "message": "He said \"Hello\" to her" }| Character | Escape sequence |
|---|---|
| Double quote | \" |
| Backslash | \\ |
| Newline | \n |
| Tab | \t |
| Carriage return | \r |
Error: undefined, NaN, or Infinity
These JavaScript values are not valid JSON. Replace them with null or a number string.
{ "value": undefined, "score": NaN, "max": Infinity }{ "value": null, "score": null, "max": 1e308 }Frequently asked questions
Try it free — no sign-up needed
Runs entirely in your browser. Nothing uploaded, nothing stored.
Open JSON Formatter & Validator →