Paste a schema and some JSON, or press Try sample. Results update as you type.
How to use
Add the schema and the data
Paste your JSON Schema on the left and the JSON to test on the right, or upload, drop or load each one from a URL. Try sample loads a schema and a record with several mistakes.
Pick the draft and read the result
Leave Draft on Detect from $schema or choose one, and decide whether formats are checked. The result updates as you type and lists each failing rule with its data path.
Generate or refine the schema
To start from data, paste JSON on the right and press Generate schema from data. Then tighten the generated rules, such as adding a minimum or an enum, and watch the result.
Why JSON Schema Validator
- Covers drafts 4 to 2020-12, including if/then/else, dependentRequired and prefixItems.
- Lists every failure with the data path, a plain-English message and the schema rule.
- Generates a starting schema from sample JSON, with required keys and formats detected.
- Runs in your browser, so schemas and payloads stay on your device.
The sample, error by error
The sample schema describes an account with an id, email, plan, seats, tags and a billing address. The sample data breaks six rules, and the table shows how each one is reported.
| Data | Rule it breaks | Reported as |
|---|---|---|
| "id": 0 | minimum 1 | /id must be at least 1 |
| "email": "ana@example" | format email | /email must be a valid email |
| "tags": ["beta", "beta"] | uniqueItems | /tags must not contain duplicates |
| "country": "pt" | pattern ^[A-Z]{2}$ | /billing/country must match the pattern |
| "nickname": "ana" | additionalProperties false | property "nickname" is not allowed |
| "plan": "team" without seats | if plan is team, then seats is required | must have the required property "seats" |
Keywords by type
Most schemas use a small set of keywords. This is what each group checks.
| Applies to | Keywords |
|---|---|
| Any value | type, enum, const, allOf, anyOf, oneOf, not, if, then, else, $ref |
| Strings | minLength, maxLength, pattern, format |
| Numbers | minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf |
| Objects | properties, required, additionalProperties, patternProperties, propertyNames, minProperties, maxProperties, dependentRequired, dependentSchemas |
| Arrays | items, prefixItems, additionalItems, contains, minContains, maxContains, minItems, maxItems, uniqueItems |