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.

Frequently asked questions

How do I check if JSON is valid?
Paste it into the input. Valid JSON shows a green Valid JSON line with a summary, such as an object with 7 keys. Invalid JSON shows the first error with its line and column.
What does "Unexpected token" in JSON mean?
The parser reached a character it didn't expect at that point, such as a } after a trailing comma, or a ' where a double quote belongs. The validator names the character and how to fix it.
Does it check against a JSON Schema?
No. It checks that the text is valid JSON syntax. Checking that fields have the right names and types needs a JSON Schema validator.
Why does it show only one error?
The first error often causes the ones after it, so it is shown alone. Fix it and the check moves on to the next problem as you type.
Is my JSON uploaded anywhere?
No. The check runs in your browser and nothing is sent to a server.