JSON to JSON Schema Converter
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"active": {
"type": "boolean"
},
"roles": {
"type": "array",
"items": {
"type": "string"
}
},
"profile": {
"type": "object",
"properties": {
"bio": {
"type": "null"
},
"website": {
"type": "string"
}
},
"required": [
"bio",
"website"
]
},
"posts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"views": {
"type": "integer"
},
"pinned": {
"type": "boolean"
}
},
"required": [
"title",
"views"
]
}
}
},
"required": [
"id",
"name",
"active",
"roles",
"profile",
"posts"
]
}Turn a JSON sample into a JSON Schema
Paste an example API response, config file, or fixture and get a pretty-printed Draft-07 JSON Schema to validate against. Whole numbers infer integer and fractions number, nested objects become nested schemas, arrays of objects are merged into one items schema where keys missing from some elements are dropped from required, and mixed values become a type union or anyOf.
When to use this tool
Use it to scaffold a validation schema from a sample value — paste an API payload, config file, or fixture and get a Draft-07 JSON Schema to drop into a validator, a CI check, or an OpenAPI definition.
Privacy and limitations
Conversion runs locally in your browser with JSON.parse, so payloads never leave the page. The schema is inferred from one sample: types, required keys, and unions reflect only the values you paste, and formats, enums, and $ref extraction are out of scope — review and tighten the schema before relying on it.