Generate, validate and explore JSON Schema (draft 2020-12) — processed privately in your browser.
Your favourites
Recently used
Start from what you are trying to do
- Turn a sample response into typed codeA JSON Schema describing an API response, and TypeScript types generated from it.4 steps, starting with JSON Formatter
- JSON to JSON Schema ConverterGenerate a JSON Schema (draft 2020-12) from an example JSON document.
- JSON Schema Example GeneratorGenerate a sample JSON document from a JSON Schema — honoring const, default, enum, formats, required properties and local $refs.
- JSON Schema ValidatorValidate a JSON document against a JSON Schema (draft 2020-12 subset): types, required properties, enums, formats, constraints, allOf/anyOf/oneOf and local $refs — every violation listed with its location.
- JSON Schema CompareCompare two versions of a JSON Schema and see what changed for API consumers — removed properties and type changes flagged as breaking, new requirements as warnings, additions as informational.
Frequently asked questions
What is JSON Schema for?
It describes the shape a JSON document must have — which fields exist, their types, which are required — so that validation is a data question rather than code scattered through an application. It is also what generates API documentation and client types.
Can a schema be generated from an example?
Yes, and that is the fastest way to start, but treat the result as a draft. A generator can only see one example, so it cannot know which fields are optional, which strings have a format, or what a sensible range is. Those you add yourself.
Which draft is supported?
The tools target the widely deployed drafts and emit the $schema keyword so consumers know which dialect to apply. Where a keyword differs between drafts, the generated schema uses the form that validates in the most implementations.
Why does my valid-looking document fail validation?
Most often additionalProperties, a required field that is present but null, or a type mismatch between a number and a numeric string. The validator reports the failing path rather than just a boolean, which is what makes the cause findable.
What is the difference between validating and formatting?
Formatting is about whitespace and says nothing about correctness. Validating checks the document against a schema you supply. A document can be perfectly formatted and completely wrong for its API, which is exactly the case a schema catches.
Can I produce example data from a schema?
Yes. The example generator walks the schema and produces a document that satisfies it, which is useful for fixtures, for API documentation and for checking that a schema actually permits the shape you intended.
Is the schema I paste sent anywhere?
No. Schemas and documents are processed in your browser, which matters because a schema often describes an internal API in more detail than anything else you have.
Contracts for your JSON
JSON Schema is the standard way to say what a JSON document must look like — which fields exist, their types, what is required. The current version of the specification is draft 2020-12, and both tools here speak it. They form a loop: infer a schema from a real payload, then generate example documents from that schema. If the generated example looks wrong, the schema — or the assumption behind it — needs work, and you found out before production did.
Where schemas pay off
Validating inbound API requests, catching breaking changes in CI, powering form generation, and giving partner teams a contract more precise than prose documentation. Start from data you already have — the JSON to JSON Schema converter gets you 80% of the way, and the constraints only you know (formats, ranges, patterns) are the remaining 20%.