JSON Schema Generator
Infer a Draft 2020-12 JSON Schema from any sample payload with automatic email, UUID, URI, and date detection.
Related data tools
All Data toolsJSON ↔ YAML Converter
Convert seamlessly between JSON and YAML with validation and indentation control.
JSON to TypeScript Types
Infer clean TypeScript interfaces or type aliases from any JSON payload with nested models.
About JSON Schema Generator
Infer a Draft 2020-12 JSON Schema automatically from any sample JSON payload, complete with required fields, integer vs number types, array item merging, and string format detection.
How to use JSON Schema Generator
- 1
Paste a representative JSON object or array into the left editor.
- 2
Customize the schema title and toggle required fields, additionalProperties, and automatic string format detection.
- 3
Copy the generated Draft 2020-12 JSON Schema or download it as a .schema.json file.
Frequently asked questions
Which string formats does JSON Schema Generator detect automatically?
When format detection is enabled, it recognizes UUIDs, ISO 8601 date-time timestamps, YYYY-MM-DD dates, email addresses, HTTP(S) URIs, and IPv4 addresses.
How are arrays of objects with optional keys handled?
The generator inspects array items, merges all observed object properties, and marks only keys present in every item as required.
Can I use the generated schema with Ajv or OpenAPI?
Yes. The output follows standard JSON Schema Draft 2020-12 syntax compatible with Ajv, OpenAPI 3.1, and IDE validation.
