Generate JSON Schema from Sample JSON Online
Overview
Writing a JSON Schema from scratch for a complex API response takes 30-60 minutes. Paste your sample JSON and the generator infers types, marks required fields, and produces a complete draft-07 schema in seconds. Use the generated schema as a starting point and refine it.
How to Use This Tool
Paste your sample JSON object or array. Click Generate Schema. The tool produces a JSON Schema draft-07 definition. Review the required fields and types, adjust optional fields, and download the schema.
Ready to get started? It's free, no registration required, and your files never leave your device.
PDF Tool →Frequently Asked Questions
How does the tool determine which fields are required?
Fields present in the sample are marked as required by default. Fields with null values are marked as optional. When using multiple sample objects, a field missing from any sample is treated as optional.
Can I generate a schema from multiple sample objects?
Yes. Paste a JSON array of multiple objects. The generator unions all field types observed across all objects and marks fields that appear in every object as required.
Does the generated schema work with ajv or other validators?
Yes. The output is standard JSON Schema draft-07, compatible with ajv (JavaScript), jsonschema (Python), and most other validation libraries.