JSON Schema Generator
Generate JSON Schema Draft 7 from any JSON object. Infers types, formats and required fields.
Frequently Asked Questions
What JSON Schema draft does this tool generate?
It generates JSON Schema Draft 7, the most widely supported version.
Does it infer string formats?
Yes — it detects date-time, date, email, and URI patterns automatically.
Can I use the output with validation libraries?
Yes. The generated schema works with ajv, zod (via coercion), and most JSON Schema validators.
Is my JSON data sent to a server?
No. Schema generation runs entirely in your browser.
What is JSON Schema?
JSON Schema is a vocabulary for annotating and validating JSON documents. A schema is itself a JSON object that describes the expected structure, types, formats, and constraints of another JSON document. It is used to:
- Validate API request and response bodies before processing.
- Generate TypeScript types, database models, or form schemas from a single source of truth.
- Document API contracts in OpenAPI / Swagger specifications.
- Power IDE autocompletion and validation for JSON config files.
JSON Schema Draft 7 Keywords
| Keyword | Applies to | Description |
|---|---|---|
| type | All | Constrains the data type: string, number, integer, boolean, array, object, null |
| required | Object | Array of key names that must be present |
| properties | Object | Schema for each named property |
| items | Array | Schema for each element in an array |
| enum | All | Value must be one of the listed values |
| minimum / maximum | Number | Inclusive lower/upper bound |
| minLength / maxLength | String | Minimum / maximum string length |
| pattern | String | Value must match this regex |
| format | String | Semantic validation: date-time, email, uri, ipv4… |
| $ref | All | Reference another schema definition (reuse) |
| anyOf / oneOf / allOf | All | Composition: union, exclusive union, intersection |
JSON Schema Validation Libraries
ajv(Node.js / browser) — the most popular, fastest JSON Schema validator.zod(TypeScript) — defines schemas in TypeScript code; can serialize to JSON Schema viazod-to-json-schema.jsonschema(Python) — reference Draft 3–7 validator.Newtonsoft.Json.Schema(.NET) — most used .NET implementation.json-schema-validator(Java) — Atlassian's library, widely used in enterprise Java.