Use representative sample data
Include optional fields, null values, nested objects, and array variations that appear in real data.
JSON tools
Generate JSON Schema from sample data
The result will appear here after you run the tool.
Press Ctrl or Command and Enter to run the tool.
About this tool
JSON Schema Generator infers a draft 2020-12 compatible schema by analyzing the types, properties, and nested structures observed in a sample JSON document. Inference and formatting happen inside your browser with no upload.
Paste a representative JSON object or array to infer types, properties, required fields, nested objects, and array item schemas. Review the result before using it for validation.
Built for daily work
How to use this tool
Include optional fields, null values, nested objects, and array variations that appear in real data.
Set a root title and decide whether observed properties should be marked as required.
A sample can only show observed types. Test the generated schema against additional real examples.
Key features
Objects become properties with inferred types, arrays get item schemas, and nested structures are followed to their full depth.
Mark all observed fields as required, or leave them optional. Control whether unrecognized properties are allowed in the schema.
Set the schema title to match the entity name in your documentation or code generator.
Download the generated schema as a file and open it directly in the JSON Schema Validator to test against new data.
Practical use cases
For local tools, input is processed in your browser and is not sent to application analytics.
Data processing noticeTechnical details
Limitations and important notes
Frequently asked questions
Not always. A sample only reveals values and types that are present. Optional fields and alternative types require additional review.
The output uses the 2020-12 schema identifier and common validation keywords.
The generator inspects array items and combines observed item types. Empty arrays use an open item schema.
Related guides and solutions
A practical introduction to generating a starting schema, strengthening constraints, and interpreting validation errors.
Learn moreA compact technical reference for writing and validating strict JSON that can be opened in standards-compliant parsers.
Learn moreA transparent explanation of local tool processing, temporary browser memory, local storage, downloads, analytics boundaries, and cases that require remote services.
Learn moreRelated tools
JSON tools
Validate JSON against a schema and receive path based errors for required fields, types, properties, and array items.
Open toolJSON tools
Format, validate, inspect, search, and analyze JSON in code, tree, table, schema, and statistics views.
Open toolDeveloper tools
Generate TypeScript interfaces from JSON with nested types, arrays, optional fields, and configurable naming.
Open tool