Paste a JSON sample and click Generate Schema. The tool inspects every property and nested object, infers types, and produces a JSON Schema draft-07 definition. Use it as a starting point for API documentation, data validation, or code generation.
Free, fast, runs in your browser. No login needed.
The generator walks your JSON recursively. For each value it encounters, it infers the JSON Schema type: string, number, boolean, null, object, or array. Object properties are listed under properties, and all discovered keys are added to required.
What gets generated automatically:
object schemas with their own propertiesitems derived from the first element$schema declaration pointing to draft-07What you will need to add manually:
required. Remove keys that are optional in production.minLength, maxLength, pattern, minimum, maximum, enum values are not inferred from a single sample.anyOf manually.The output is a valid starting point, not a production-ready schema. Treat it as scaffolding and review it against the full range of data your system produces.
JSON Schema draft-07, indicated by the $schema field in the output. Draft-07 is widely supported by validators like ajv and is compatible with most OpenAPI 3.0 tooling.
Yes. Every key found in your sample appears in the required array. This is correct if your sample is representative of the minimum viable document. If some fields are optional in production, remove them from required manually.
Yes. Nested objects produce their own properties and required blocks recursively. Arrays produce an items schema derived from the first element in the array.
The generator uses JavaScript's typeof, which returns "number" for both integers and floats. If your field only holds integers, change the type to "integer" manually.
No. The schema generator is a custom recursive function built into the tool. It does not use quicktype, ajv, or any external library.
Yes, but review it first. Paste the schema into a validator like ajv or use it in an OpenAPI spec. Since required includes all keys and there are no format/pattern constraints, validation will be permissive until you refine the schema.