JSON Validator
Check JSON and see exactly where it breaks
Input (JSON)
Formatted
Valid JSON: object with 7 keys
JSON Validator guide
A single missing comma or stray quote makes a whole JSON file unreadable to a program, and parser error messages are often cryptic. The JSON Validator checks your JSON as you type and, if it is broken, names the exact line and column with a plain explanation of the fix.
Common JSON errors
- Trailing comma. JSON doesn't allow a comma after the last item, as in [1, 2,]. Remove it.
- Single quotes. Strings and keys need double quotes: "name", not 'name'.
- Unquoted keys. JavaScript allows {name: 1}, but JSON needs {"name": 1}.
- Comments. JSON has no // or /* */ comments. Remove them, or use a format that allows them, such as YAML.
- Missing comma. Two values side by side, as in "a": 1 "b": 2, need a comma between them.
- Cut-off JSON. A missing } or ] at the end, often from copying only part of a response.
Reading the error
The message says what is wrong first. Below it are the line and column, and the line itself with a ^ under the character where the problem starts. Fix that spot and the check runs again as you type.
Unexpected token errors
Messages like "Unexpected token } in JSON at position 42" come from JSON.parse in browsers and Node.js. Paste the same text here to see which line that position is on and what should have been there.