Schema Generator
Loading schema generator...
Generate JSON Schema from JSON with this browser-based schema generator. Paste an object or array to infer property types, nested structures, formats, and required fields, then review and edit the generated Draft 2020-12 schema. Your input is processed in the browser.
Paste a JSON object or array into the generator. It infers property types, nested objects, array item shapes, and common string formats, then produces a JSON Schema Draft 2020-12 document that you can edit, copy, or download. The generator does not select a draft version; its output uses 2020-12.
{
"id": 17,
"name": "Ada",
"tags": ["admin", "active"],
"profile": { "email": "ada@example.com" }
}{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": { "type": "integer", "examples": [17] },
"name": { "type": "string", "examples": ["Ada"] },
"tags": { "type": "array", "items": { "type": "string", "examples": ["admin"] } },
"profile": {
"type": "object",
"properties": {
"email": { "type": "string", "format": "email", "examples": ["ada@example.com"] }
},
"required": ["email"]
}
},
"required": ["id", "name", "tags", "profile"]
}With Infer Required enabled, non-null fields in a single object are marked required. For an array of objects, a field is required only if it appears in every sampled item. Null values remain represented in the schema, and mixed array item types are combined. This describes the sample you provide; review required fields and other business rules before using the schema as an API contract.
The JSON Schema Generator processes the data you paste or open in your browser. Shared links can contain that data in the URL, so check the link before sending it to someone else.
Processing time and available file size depend on the input and your browser's memory and processing capacity.
The generator emits JSON Schema Draft 2020-12 and does not currently provide a draft version selector.
Yes. It recursively analyzes nested objects and array items up to 50 levels deep. For arrays, it samples up to 20 items to infer the item schema.
When Infer Required is enabled, non-null fields in an object are marked required. For arrays of objects, a field is required only when it appears in every sampled item. This reflects the examples you provide, so review it against your application rules.
Review required fields, nullable values, and application-specific rules against more examples. Empty arrays leave the item type open. When merging multiple object items, the generator can omit Strict Mode's additionalProperties rule; check and edit the output if you need to reject extra fields.
No. The JSON and generated schema are processed in your browser. A share link can include your input in its URL, so share it only with people who should see that data.