JSON Validator
Validate JSON and get detailed error messages
About JSON Validator
Tells you whether your text is strict JSON, using the browser's built-in parser. For valid input it shows whether the root is an object, an array or a primitive and how many top-level keys or items it holds; for invalid input, the parser's error message explains what went wrong. Handy for checking API payloads, config files and test fixtures before they reach your code.
Category: Encoding.
Frequently asked questions
Why does my JSON fail validation?
▾
Common causes: trailing commas (not allowed in JSON), single-quoted strings, comments, unquoted keys, or a leading/trailing character. Only the first error is reported, and the message comes from your browser's JSON parser, so its wording, and whether it includes a line and column, varies by browser.
Does it accept JSON5 or JSON with comments?
▾
No. Validation follows strict JSON as defined in RFC 8259, the same grammar JSON.parse() uses, so comments, trailing commas, single quotes and unquoted keys are errors even though JSON5 and the JSONC dialect used by tsconfig.json and VS Code settings allow them.
Does it detect duplicate keys?
▾
No. Like JSON.parse(), it accepts an object that repeats a key and keeps only the last value, because RFC 8259 recommends unique names but doesn't require them. The key count shown for a valid object counts each distinct key once.
Does this validate JSON Schema?
▾
This tool validates JSON syntax only. For JSON Schema validation (checking that data matches a schema definition), a separate tool is needed.