JSON Tool 02
JSON to JSON Schema
Turn a sample document into a JSON Schema with inferred types, required keys and nested structure — then copy or download it.
Input
Sample JSON in, schema out
or paste your own JSON
Schema
Schema appears here
Types, required fields and nesting are inferred as you convertAbout JSON Schema conversion
JSON Schema is a vocabulary for describing and validating JSON documents. This tool infers the structure of your sample — types, arrays, nested objects — and writes a draft-07 schema you can copy or download.
Example input
{
"name": "John Doe",
"age": 30,
"active": true,
"hobbies": ["reading", "coding"],
"address": {
"street": "123 Main St",
"city": "New York"
}
}
Generated schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"name": { "type": "string" },
"age": { "type": "number" },
"active": { "type": "boolean" },
"hobbies": {
"type": "array",
"items": { "type": "string" }
}
}
}
Frequently asked
- Which JSON Schema version is generated?
- Draft-07. The output opens with "$schema": "http://json-schema.org/draft-07/schema#" and uses the classic type / properties / required vocabulary, so Ajv and most validators accept it as-is.
- How are required fields decided?
- Every key present in the sample object is listed as required. Inference runs on one document, so a key that happens to be missing from your sample will not be marked required — edit the schema if your API may omit it.
- How are nested objects and arrays typed?
- Each nested object becomes its own schema block, and arrays become an "array" with an items schema inferred from their elements.
- Is my JSON uploaded?
- No. Inference and schema generation run in the page; the document never leaves the browser.