JSON Schema Generator
Paste a sample JSON value and generate a Draft-07 JSON Schema describing its shape -- types, required
fields, nested properties, and array items.
About This Tool
Writing a JSON Schema by hand from an example payload is mechanical but tedious: walk every key, note its
type, recurse into nested objects and arrays. This tool does that walk for you from a single sample value,
producing a Draft-07 schema with type per field, a required array, nested
properties, and an items schema for arrays.
It only ever sees one example, so the output is a draft to edit, not a finished spec -- see the FAQ on
required below. Feed the result straight into JSON Schema
Validator to check it against more real records. If you need the OpenAPI 3.0 dialect instead of plain
JSON Schema, use JSON to OpenAPI Schema.
Key Features
- Draft-07 output: matches the dialect used by this site's JSON Schema Validator, with a
$schemakey set accordingly. - Recursive type inference: string/number/integer/boolean/null/array/object per field, at every nesting level.
- Array shape detection: a uniform array infers one
itemsschema from its first element; a mixed array falls back toanyOflisting each distinct shape. - Optional schema title: set a
titlevalue without editing the output by hand. - File upload & drag-and-drop: load a
.jsonfile directly instead of pasting. - Keyboard-driven: Cmd/Ctrl+Enter to generate, Cmd/Ctrl+Shift+C to copy the output.
Example
Sample input:
{"name": "Ada", "age": 30, "tags": ["admin", "staff"]} generates:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"required": ["name", "age", "tags"],
"properties": {
"name": { "type": "string" },
"age": { "type": "integer" },
"tags": { "type": "array", "items": { "type": "string" } }
}
}