JSON Validator
Validate JSON and pinpoint syntax errors instantly.
Was this tool helpful?
Thanks for the feedback!
The JSON Validator tells you whether a piece of text is valid JSON according to the standard (RFC 8259) and, if it isn't, shows the parser's error with the position where it stopped. Use it before committing a config file, after editing an API request by hand, or when a service rejects your payload with a vague "bad request".
What you see
Valid input returns ✓ Valid JSON. Invalid input returns ✗ Invalid JSON: followed by the browser's message. Chrome and Edge describe the problem and give a location, for example:
{"name":"Asha" "age":30}
✗ Invalid JSON: Expected ',' or '}' after property value
in JSON at position 15 (line 1 column 16)
Positions count from zero, so position 15 is the 16th character: here, the quote that opens "age", where a comma was expected. Other browsers word their messages differently.
Errors this catches, with typical messages
- Trailing comma:
{"a":1,}→ "Expected double-quoted property name". In an array,[1, 2, 3,]gives "Unexpected token ']'". - Curly quotes:
{“name”: “Asha”}fails at column 2. Word processors and chat apps often replace straight quotes with typographic ones when you paste JSON through them. - Leading zeros:
{"price": 007}→ "Unexpected number". JSON numbers can't start with 0 unless the number is 0 itself. - JavaScript-only values:
NaN,Infinity,undefinedand hex numbers such as0x1Fare not JSON. - Extra content:
{"a":1} // note→ "Unexpected non-whitespace character after JSON", because comments aren't allowed. - Empty or cut-off input → "Unexpected end of JSON input".
What "valid" does and doesn't mean
The check is purely about syntax. A few results surprise people:
- Any single value is valid.
"just a string",42,trueandnullall pass, because modern JSON allows any value at the top level, not only objects and arrays. - Duplicate keys pass.
{"a":1,"a":2}is reported as valid. The standard says names should be unique but doesn't forbid repeats, and most parsers silently keep the last one, which can hide a copy-paste mistake. - Structure isn't checked. A payload can be perfect JSON and still be missing a required field or have a number where your API expects text. That needs a JSON Schema check in your code or API tooling.
Fixing errors efficiently
Go to the reported line and column and look just before it; the real mistake, such as a missing comma or an unclosed quote, is usually at the end of the previous value. Fix one error and validate again, since the parser stops at the first problem it finds. Once the JSON passes, the JSON Formatter makes it readable, and the JSON Minifier compacts it for sending. The text is checked by your browser's own parser and not uploaded.