JSON Validator
Check JSON syntax and locate errors.
JSON Validator – Check JSON Syntax Online
Paste JSON into this JSON validator and it tells you instantly whether it's valid. Valid documents get a green confirmation, a formatted copy, and structure statistics — how many objects, arrays, keys, and values they contain and how deeply they are nested. Invalid documents get a precise error message with the line and column of the problem.
Why validate JSON?
A single stray comma can make an API reject a request, a deployment fail to read its configuration, or a front end crash while parsing a response. Validating before you send, commit, or deploy saves a lot of debugging. The validator uses the same strict parser that browsers and Node.js use (JSON.parse), so if it passes here it will parse in your application too.
The rules of valid JSON
- Keys must be strings in double quotes:
{"name": "Ann"}, not{name: 'Ann'}. - Values are strings, numbers,
true,false,null, objects, or arrays. - No trailing comma after the last item of an object or array.
- No comments, no
undefined, noNaNorInfinity. - Special characters in strings, such as quotes, backslashes, and line breaks, must be escaped.
Reading the statistics
The chips under the result count objects, arrays, keys, strings, numbers, booleans, and nulls, and show the maximum depth. They make it easy to spot, for instance, that a list is empty or that the data is nested much deeper than expected.
Fixing errors
When the JSON is close but not quite valid — copied from JavaScript code, a log, or a Python dict — let the JSON Fixer repair it. To check relaxed formats, use the JSON5 Validator or the TOML Validator.
Frequently Asked Questions
What makes JSON invalid?
The most common mistakes are trailing commas after the last item, single quotes instead of double quotes, unquoted keys, comments, missing commas between items, and unescaped line breaks or quotes inside strings. Values like undefined, NaN, and Infinity are also not allowed in JSON.
How do I find where the error is?
The validator reports the line and column where the parser stopped. The actual mistake is usually right there or just before it — for example, a missing comma at the end of the previous line shows up as an error at the start of the next property.
Does this validate against a JSON Schema?
No, this tool checks syntax (is it well-formed JSON?) and shows structure statistics. Schema validation, which checks required fields and types, needs a separate JSON Schema document.
My JSON has comments. Is it valid?
Not as strict JSON. Comments are allowed in JSON5 and JSONC (used by VS Code and tsconfig.json). Check such files with the JSON5 Validator, or remove the comments automatically with the JSON Fixer.