JSON Schema Generator
Drop in a JSON sample and get a clean schema (draft-07 or draft-2020-12) and matching TypeScript types — with format detection, required-field inference, and enum hints.
Source size
536 B
Schema size
2.1 KB
Inferred properties
24
JSON sample
Paste a real JSON document — the bigger the sample, the better the schema. Files are read locally; nothing leaves your browser.
Generator options
Tune the draft, required fields, and string format detection.
Draft
Required fields
Additional properties
Nullable handling
Detect string formats
Tag dates, emails, URIs, UUIDs, and IP addresses automatically.
Detect enums in arrays
When the same string repeats across array samples, treat it as an enum.
Add $id + title
Useful when the schema is published or referenced elsewhere.
{
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"name": {
"type": "string"
},
"email": {
"type": "string",
"format": "email"
},
"active": {
"type": "boolean"
},
"score": {
"type": "number"
},
"rank": {
"type": "integer"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"address": {
"type": "object",
"properties": {
"city": {
"type": "string"
},
"zip": {
"type": "string"
},
"geo": {
"type": "object",
"properties": {
"lat": {
"type": "number"
},
"lng": {
"type": "number"
}
},
"required": [
"lat",
"lng"
],
"additionalProperties": true
}
},
"required": [
"city",
"zip",
"geo"
],
"additionalProperties": true
},
"orders": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"total": {
"type": [
"number",
"integer"
]
},
"currency": {
"type": "string"
},
"shippedAt": {
"type": [
"string",
"null"
]
}
},
"required": [
"id",
"total",
"currency",
"shippedAt"
],
"additionalProperties": true
}
},
"website": {
"type": "string",
"format": "uri"
}
},
"required": [
"id",
"createdAt",
"name",
"email",
"active",
"score",
"rank",
"tags",
"address",
"orders",
"website"
],
"additionalProperties": true,
"$schema": "http://json-schema.org/draft-07/schema#"
}