JSON Schema Validator & Generator
Check JSON data against a JSON Schema and see every error with its instance path, schema path and line number, or generate a starting schema from a sample document. Supports draft 2020-12, 2019-09 and draft-07 with format validation.
Private by design:
anything you enter is processed in your browser only. It is never uploaded to or logged on our servers.
Schemas and data are validated locally with Ajv. Remote $ref URLs are not fetched.
Errors (click a row to jump to the line)
| # | Instance path | Message | Schema path | Line |
|---|
JSON data with failing lines highlighted
About JSON Schema validation
JSON Schema describes what a JSON document must look like: which properties exist, their types, which are required, allowed values, string formats and nested structures. It is used to validate API requests and responses (OpenAPI 3.1 uses JSON Schema 2020-12 directly), configuration files, form input and messages between services.
This validator uses Ajv, the most widely used JSON Schema implementation for JavaScript, with ajv-formats for formats such as email, uri, date-time and uuid. The draft is picked from the schema's $schema keyword, or you can force one. With Report all errors on, every failing keyword is listed instead of stopping at the first one.
Each error shows the instance path (a JSON Pointer to the failing value, such as /items/1/qty), the schema path (the keyword in the schema that failed, such as #/definitions/item/properties/qty/minimum) and the line in your data, which is highlighted below the table.
The Generate schema tab infers a schema from a sample: types, nested objects, required keys, array item schemas merged across all elements, nullable and mixed types, and common string formats. Treat the result as a starting point and add limits, enums and descriptions by hand. To check plain JSON syntax only, use the JSON validator; to compare two documents, use the JSON diff tool; to validate a whole API description, use the OpenAPI validator.
Reference Guide
Differences between the supported drafts that most often cause surprises:
| Feature | Draft-07 | Draft 2019-09 | Draft 2020-12 |
|---|---|---|---|
| Reusable definitions | definitions | $defs | $defs |
| Tuples (fixed positions) | items: [..] + additionalItems | items: [..] + additionalItems | prefixItems + items |
Siblings next to $ref | Ignored | Applied | Applied |
| Conditional properties | dependencies | dependentRequired, dependentSchemas | dependentRequired, dependentSchemas |
| Close extended schemas | Not available | unevaluatedProperties | unevaluatedProperties, unevaluatedItems |
$schema URI | http://json-schema.org/draft-07/schema# | https://json-schema.org/draft/2019-09/schema | https://json-schema.org/draft/2020-12/schema |
Draft-04 and draft-06 schemas are checked with draft-07 rules and a notice. Remote $ref URLs are not downloaded; put shared schemas under $defs and reference them with #/$defs/name.
Was this tool useful?
Thanks for your feedback!
Could not send your feedback. Please try again later.
Frequently Asked Questions
Draft 2020-12, draft 2019-09 and draft-07. The draft is detected from the $schema keyword, or you can choose one. Draft-04 and draft-06 schemas are checked with draft-07 rules and a notice.
The instance path is a JSON Pointer to the value in your data that failed, for example /items/1/qty. The schema path points to the keyword in the schema that rejected it, for example #/properties/items/items/properties/qty/minimum.
Yes, with Validate formats switched on. The validator uses ajv-formats, which checks email, uri, date, time, date-time, uuid, ipv4, ipv6, hostname, regex and more. Without it, format is only an annotation.
It walks a sample document and records the type of every value. Objects get properties and required keys, array items are merged into one item schema, values that are sometimes null become nullable, and common string formats are detected. Review the result and add limits, enums and descriptions.
References inside the same schema, such as #/$defs/address, work. Remote URLs are not downloaded, so copy shared definitions into $defs.
Related Tools
All Validation Tools →XML Validator
Validate XML documents online for well-formedness and struct...
HTML Validator
Validate HTML code and catch markup errors, unclosed tags, a...
CSS Validator
Validate CSS stylesheets online for syntax errors, unknown p...
Bcrypt Hash Generator & Checker
Hash passwords with bcrypt using a configurable cost factor...
PBKDF2 Key Derivation Generator
Derive keys from passwords with PBKDF2-HMAC-SHA1/256/512, ch...
SSH Key Generator & Fingerprint Tool
Generate Ed25519 or RSA SSH key pairs in your browser and ca...