JSON Schema
Generate a JSON Schema from JSON
Create a JSON Schema from a sample document in seconds, edit it to fit your rules, and validate other JSON against it — without leaving the browser.
How to use it
- Paste a sample document into the editor.
- Open Tools → Schema, choose a draft and click Generate from editor.
- Review and edit the schema, then click Validate editor JSON to check documents against it.
Example
{
"id": 42,
"name": "Ada",
"tags": ["admin"]
}{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"id": { "type": "integer", ... },
"name": { "type": "string", ... },
"tags": { "type": "array", "items": { "type": "string", ... } }
},
"required": ["id", "name", "tags"]
}The generator also adds length and range limits based on the sample values. Loosen or remove them before using the schema for other documents.
Features
Three drafts
Generate Draft 2020-12, Draft-07 or Draft-04 schemas.
Types and required fields
Property types, array item types and required keys are inferred from the sample.
Validate
Check the editor JSON against any schema and see a detailed report.
Bring your own schema
Paste an existing schema to validate documents against it.
Frequently asked questions
Which JSON Schema drafts are supported?
Draft 2020-12, Draft-07 and Draft-04. Pick one before generating.
Why does validation fail on a different document?
Generated schemas include limits taken from your sample, such as exact string lengths and number ranges. Edit or remove them to allow other values.
Can I validate against my own schema?
Yes. Paste your schema into the schema box and click Validate editor JSON.
Is my data private?
Yes. Generation and validation run locally in your browser.