JSON Schema Validator
A tool that validates JSON against a JSON Schema using Draft 2020-12. Violations such as type mismatches, missing required properties, enum, and numeric or string constraints are listed with their data location, schema location, and reason. JSON syntax errors, schema problems, and validation errors are reported separately — all processed in your browser.
Supported specification: JSON Schema Draft 2020-12 (validated only when $schema is omitted or set to the value below). format is treated as an annotation and not validated. https://json-schema.org/draft/2020-12/schema
Result
Enter JSON and a JSON Schema to see the validation result here.
How to use
- Enter the JSON to validate on the left and the JSON Schema on the right. Use "Load sample" to try it out.
- Validation runs automatically, and the result shows whether the JSON is valid.
- If there are violations, each one is listed with its data location (JSON Pointer), reason, and schema location.
- Syntax errors, schema problems, and unresolved $ref values are reported with details.
About this tool
JSON Schema is a specification for describing the structure, types, and value constraints of JSON data. It's used to check that API requests and responses or configuration files have the expected shape.
This tool supports Draft 2020-12. If $schema points to another version, it's reported as unsupported instead of being validated with the wrong rules. References within the same schema (such as #/$defs/...) are resolved, but external URLs are never fetched and are reported as unresolved. The format keyword is treated as an annotation, which is the default in the specification.
Your JSON and schema are never sent to a server.
Validate {"age":"20"} against {"type":"object","properties":{"age":{"type":"integer"}}}. A type violation appears at /age. Changing the data to {"age":20} passes; numeric strings are not automatically converted to integers.
A property declared under properties is still optional unless required says otherwise. The empty object {} therefore passes this example too. Decide separately whether to check a value's type and whether to require its presence. Use the error path together with the constraint keyword to locate the fix.
Frequently asked questions
Can I use older drafts such as Draft 7?
Only Draft 2020-12 is supported for now. If $schema specifies Draft 7 or another version, it's reported as unsupported and not validated.
Is format (such as email) validated?
In Draft 2020-12, format is an annotation by default, so this tool doesn't validate it. Use pattern if you need strict format checks.
Can I use $ref to external files?
External URLs and files are never fetched. They're reported as unresolved, so include the referenced schema under $defs in the same schema.