JSON Schema, without the spec-induced headache
JSON Schema is a contract for JSON data. It says which properties an object must have, what type each value is, which strings must look like emails or dates, and what happens when something unexpected shows up. APIs use it to reject malformed requests before they touch business logic; config systems use it to fail fast on a typo'd settings file; code generators use it as the blueprint for typed models.
The ecosystem revolves around drafts — versioned specifications. Draft 2020-12 is the current mainstream one, and it is what this tool speaks: you can validate a document against a schema and get every violation with its exact location, or go the other direction and infer a schema from real sample data instead of writing one by hand.
Open the free JSON Schema — no signup, runs entirely in your browser.
How to use it
- Pick Validate to check a document, or Generate to infer a schema from an example.
- For validation, paste your JSON instance on the left and the schema on the right — results appear as you type.
- Read the error list: each entry is a JSON Pointer to the offending value plus the keyword that failed.
- For generation, paste a representative sample and copy the emitted draft 2020-12 schema.
Why this one
- Full error lists, not stop-at-first-failure: up to 100 violations per run, each with its exact path.
- Schema compile errors are reported separately from validation failures — you always know which side to fix.
- Format mismatches (email, date-time, uuid, uri) surface as warnings, matching annotation-style format semantics.
- Generation is deterministic and honest: integer vs number, sorted required lists, unions for mixed data, format hints only when every string agrees.
- Everything runs locally in the browser — pasted data never leaves your device.
Frequently asked questions
What is the difference between validation and generation?
Validation checks an existing JSON document against an existing schema and lists every place the document breaks the rules. Generation goes the other way: you provide example JSON and the tool infers a schema that describes it. Most people generate first, refine by hand, then validate against the refined schema.
Why did my format: email field pass even with a bad email?
This tool treats format as an annotation, the same stance most validators take by default. A value that fails a format check produces a warning, not a hard error — structural rules like type, required and enum still fail normally. If you need strict format enforcement, add a pattern keyword with an explicit regular expression.
Can I use $ref to reference other schemas?
Local references work: pointers like #/$defs/address that resolve within the same schema document. Remote references (URLs to other schema files) are never fetched — a schema that needs one fails with a clear compile error. Inline shared definitions under $defs to keep everything self-contained.
Which JSON Schema draft does the tool use?
Draft 2020-12, the current mainstream specification. Generated schemas declare it explicitly via the $schema keyword, and validation is pinned to it so results are consistent between the browser and the API.