EthicalFusion

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, undefined and hex numbers such as 0x1F are 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, true and null all 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.

Frequently asked questions

Why is my JSON invalid when it works in JavaScript?
JavaScript object literals allow single quotes, unquoted keys, trailing commas and comments. JSON allows none of these.
What does "position 15" mean in the error?
It is a zero-based character count from the start of your input, so position 15 is the 16th character. Chrome and Edge also show the line and column.
Does the validator check duplicate keys?
No. Repeated keys are accepted, as most parsers do, and the last value wins. Search your JSON manually if you suspect duplicates.
Is a plain number or string valid JSON?
Yes. Current JSON standards allow any value at the top level, so 42 or "hello" on its own is valid.
Can it validate against a JSON Schema?
No, it checks syntax only. Validating required fields and types needs a JSON Schema library in your project.

Related tools

Embed this tool on your site

Paste it into any blog or website. Free, with a credit link.