JSON Schema generator
Paste JSON on the left — the schema appears on the right, as you type.
JSON Schema
How to use it
- Paste a sample JSON document on the left — object, array or a single value. The schema is generated live, as you type.
- Pick the Schema version (Draft 7 or 2020-12), and toggle string-format detection, example values, and whether every property is required.
- Copy or download the result as schema.json. Nothing is uploaded: the whole document is parsed in your browser.
Example
Sample JSON
{
"id": 42,
"name": "Ada Lovelace",
"email": "ada@example.com",
"active": true,
"tags": ["admin", "editor"],
"profile": { "score": 4.5, "verified": false }
}JSON Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"email": { "type": "string", "format": "email" },
"active": { "type": "boolean" },
"tags": { "type": "array", "items": { "type": "string" } },
"profile": {
"type": "object",
"properties": {
"score": { "type": "number" },
"verified": { "type": "boolean" }
},
"required": ["score", "verified"],
"additionalProperties": false
}
},
"required": ["id", "name", "email", "active", "tags", "profile"],
"additionalProperties": false
}Generated with the default rules: Draft 7, formats on, all properties required. The email string gets a format hint; the integer stays exact, and the nested profile becomes its own object schema.
Rules, limits and known issues
- Types are inferred from the sample: object, array, string, integer, number, boolean, null. Array items are merged — objects across elements union their keys, and a key missing from some elements is not marked required.
- Mixed types inside one array become an anyOf; an empty array yields type:array with no items (the element type is unknown from the sample).
- String formats (email, UUID, URI, date, date-time) are guessed from the value — they are hints, not validation of every possible value. Turn them off with the toggle.
- Duplicate keys keep the last value, as JSON.parse does. Strict JSON only (RFC 8259): comments, trailing commas and single quotes are rejected with a line/column message.
- The schema is standard JSON, so its keywords and output never change with the page language. Example values are reconstructed natively, so an extreme integer (e.g. 12345678901234567890) may be rounded in the example only.
- Limits: 1,000,000 characters and 512 nesting levels. Over either limit you get an error, never a truncated result. File upload reads the local file only — nothing is uploaded.
Related tools
What people usually need next, once they have a schema.