What is a JSON validator?
A JSON validator checks whether text follows standard JSON syntax. It catches problems such as missing commas, unclosed brackets, single quotes, invalid escapes, comments, and malformed numbers.
This validator accepts any value allowed by RFC 8259 at the document root, including an object, array, string, number, boolean, or null. It checks syntax only; valid JSON can still contain the wrong fields or values for an API.
How to validate JSON
- Paste or type JSON in the editor, or select Example.
- Wait for automatic validation or select Validate JSON.
- Review the result. If the JSON is invalid, select a diagnostic to move to its line and column.
Editing the input clears the previous result until validation runs again.
JSON validation example
This JSON is invalid because the last property has a trailing comma:
{
"name": "Alice",
"age": 28,
}
Remove the trailing comma to make it valid:
{
"name": "Alice",
"age": 28
}
Common JSON syntax errors
| Error | Why it is invalid |
|---|---|
| Trailing comma | The final property or array item ends with a comma. |
| Single quotes | JSON keys and strings must use double quotes. |
| Unquoted key | Every object key must be a double-quoted string. |
| Missing comma | Adjacent properties or array items are not separated. |
| Unclosed structure | A string, object, or array is missing its closing character. |
| Comment | Standard JSON does not allow comments. |
| Invalid number | Leading zeros, NaN, and Infinity are not valid JSON numbers. |
JSON validator vs formatter vs Schema validator
| Tool | Primary purpose |
|---|---|
| JSON Validator | Check whether text follows strict JSON syntax and locate errors. |
| JSON Formatter | Add indentation and line breaks to valid JSON. |
| JSON Schema Validator | Check fields, types, required values, and other structural rules. |
Formatting changes whitespace, while validation leaves the input unchanged. Schema validation is a separate task performed after the JSON syntax is valid.
JSON validator FAQ
Can a JSON document start with an array or primitive value?
Yes. An array, string, number, boolean, or null can be a complete JSON document; the root does not have to be an object.
Are duplicate keys valid JSON?
Duplicate object keys are syntactically accepted, but different software may keep different values. This validator reports them as compatibility warnings rather than syntax errors.
Does valid JSON mean an API will accept it?
No. Valid JSON only confirms that the text follows JSON syntax. An API may still require specific fields, types, formats, or business rules.