JSON Schema Generator
Automatically generate a professional JSON Schema (Draft 07) from any JSON object for API development and validation.
Input JSON
Generated Schema
Paste JSON and click generate...
About JSON Schema Generator
JSON Schema describes the shape of JSON data: which fields exist, their types and which are required. Paste a sample JSON document and this tool writes a draft-07 schema from it. It handles nested objects and arrays, and when you paste an array of objects it merges all of them into one description, marking a field as required only if it appears in every object.
Types are worked out from the sample values: string, number, integer, boolean, null, object and array. If a field has different types in different samples, for example a string in one and null in another, the schema lists both types.
A schema made from examples is a starting point. It does not know your rules, so it will not add formats (such as email or date), minimum and maximum values, patterns or enums. Review it, tighten it, and test it against more data before relying on it for validation. Your JSON stays in your browser.
Who uses it and when
API contracts
Draft a schema from a real response.
Validation
Create a base schema for a validator library.
Documentation
Describe the shape of your data for others.
Config files
Generate a schema for editor autocomplete.
Why use this JSON Schema Generator
A JSON Schema from your sample data.
Nested data
Objects and arrays at any depth.
Merges array items
Combines all elements and finds required fields.
Browser-only
Your data is not uploaded.
How it works
Paste sample JSON
An object or an array of objects.
Click Generate
The schema appears.
Copy and refine
Add formats and limits that fit your rules.
Frequently asked questions
Which JSON Schema version is used?
Draft-07.
How is a field marked required?
If it appears in every sample object.
Will it detect emails or dates?
No. It only detects basic types, so add formats yourself.
Does it validate JSON?
No. It generates a schema. Use a validator library to check data against it.