Category: Developer tools
JSON Schema Generator
Generate a draft-07 JSON Schema from a JSON document
Paste a JSON document and get back a draft-07 JSON Schema inferred from its shape, with object properties marked required and nested structures described recursively. Runs entirely in your browser.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"isActive": {
"type": "boolean"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"address": {
"type": "object",
"properties": {
"city": {
"type": "string"
},
"country": {
"type": "string"
}
},
"required": [
"city",
"country"
]
}
},
"required": [
"id",
"name",
"isActive",
"tags",
"address"
]
}Everything on this page is processed in your browser. Nothing is uploaded.
Everything on this page is processed in your browser. Nothing is uploaded.
What this tool does
Writing a JSON Schema by hand from scratch is slow, so this tool infers one from a real example instead: every object becomes a `type: "object"` schema listing its properties and marking all of them required, every array becomes a `type: "array"` schema with an `items` schema for its entries, and primitives map to their matching JSON Schema type. As with any schema generated from one sample, it reflects only what that sample happened to contain, so fields that are sometimes missing or fields that are actually optional need manual adjustment afterward.
How to use it
- Paste a JSON document, or load the example.
- Optionally set a schema title.
- Copy the generated JSON Schema.
Privacy
This tool runs entirely in your browser. Your input is never uploaded, stored or shared — closing the tab removes it.
Frequently asked questions
- Is my JSON uploaded anywhere?
- No. Parsing and schema inference happen in JavaScript running in the page, so your data never leaves your device.
- Are all the properties really required?
- Only in the schema. Since the input is one sample, every key it contains is marked required by default; remove keys from `required` for fields that can be absent.
- Which JSON Schema draft does this produce?
- Draft-07, identified by the $schema URI in the output, which is broadly supported by validators and code generators.