Search tools...⌘K
JSON Schema Generator
Infer a Draft-07 schema from a sample, then validate data against it.
Sample JSON
JSON Schema (Draft-07)
How to Generate and Use a JSON Schema
- 1
Paste a representative sample
Use a real API response rather than a trimmed one — the schema can only describe fields it actually sees.
- 2
Tune the strictness
Required marks every observed key as mandatory. Formats adds detected string formats such as email, uuid and date-time.
- 3
Switch to Validate
Paste the generated schema and a different payload to check it. Every failing rule is listed with the exact path that broke it.
- 4
Wire it into CI
Commit the schema and validate payloads in tests or a pipeline step with Ajv, so contract drift fails the build instead of production.
Frequently Asked Questions
It is a machine-readable contract describing the shape of a JSON document — which fields exist, their types, which are required and what values are allowed. It is used to validate API requests and responses, to generate documentation and forms, and to catch contract drift in CI before it reaches production.
It describes exactly what it saw and nothing more. A field that happens to be null in your sample is typed as null, and an optional field that is absent will not appear at all. Treat the output as a strong first draft, then widen the types the API can genuinely return.
Draft-07, which is the most widely supported version across validators, code generators and API tooling. Validation uses Ajv, which supports Draft-07 along with 2019-09 and 2020-12.
date-time, date, email, uri, uuid and ipv4. Detection is pattern based, so a string that merely looks like an email is annotated as one — remove any format that is not part of your real contract.
It makes the schema strict: any key not in the sample is rejected. That catches typos and unexpected fields, which is usually what you want for request validation. Delete the line if your API is intentionally forward-compatible and may add fields.
No. Both generation and validation run in your browser, so production payloads and any personal data in them stay on your machine.