JSON Validator is a free tool that checks whether text is valid JSON. If it isn’t, it lists every problem with its line and column number, explains what is wrong in plain language, and suggests a fix. Checking happens in your browser as you type, and your JSON is never uploaded.
How to validate JSON
- Paste your JSON into the box, or click Open file to check a
.jsonfile. - The result updates as you type: a green tick for valid JSON, or a list of problems.
- Click Show next to a problem to jump to it and highlight it.
- Fix the first problem, then check the list again. Later problems are often caused by the first one.
Example
This JSON has two mistakes:
{
"name": "Weekly report",
"recipients": ["sam@example.com",],
"day": "Monday"
"time": "09:00"
}The validator reports:
- Line 3: expected a value, with the hint to remove the trailing comma before
]. - Line 5: expected a comma between
"Monday"and"time".
What it checks
- Brackets and braces are balanced and properly nested.
- Property names and text use double quotes.
- Items are separated by commas, with no comma after the last one.
- Numbers are written correctly (no leading zeros such as
007, noNaN). - Text contains no raw tabs or line breaks and only valid escape sequences such as
\n. - There is nothing after the end of the JSON.
It also warns about duplicate keys, such as two "id" properties in the same object. That is technically valid, but most programs silently ignore all but the last one, so it’s usually a bug.
JSON versus JavaScript objects
JSON looks like JavaScript but is stricter. Code that works in JavaScript, such as { name: 'Ana', }, is not valid JSON because of the unquoted name, the single quotes and the trailing comma. Some tools accept relaxed variants (JSON5, or JSONC with comments, as used by VS Code settings), but APIs and most programs expect strict JSON, which is what this validator checks.
Once your JSON is valid, you can tidy it with the JSON Formatter or generate types from it with JSON to TypeScript.
Frequently asked questions
What makes JSON invalid?
The usual culprits are a comma after the last item in a list or object, single quotes, property names without double quotes, comments, and values such as undefined or NaN that JSON does not support.
Why do I see several errors when I only made one mistake?
One mistake, such as a missing quote, can confuse everything after it. Fix the first error listed and the others often disappear.
What is a duplicate key warning?
The same property name appears twice in one object. It is technically allowed, but most programs silently keep only the last value, which is usually a bug.
Does this validate against a JSON Schema?
Not yet. This checks that the text is well-formed JSON. Checking that it has the right fields and types (JSON Schema validation) is a separate tool.
Last updated