JSON to JSON Schema Generator
Paste a JSON value and get a JSON Schema that describes its shape — with inferred types, required properties, and merged item schemas for arrays.
Last updated: May 27, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is JSON to JSON Schema Generator?
JSON Schema is a vocabulary for describing the structure and constraints of JSON data. It is the foundation of OpenAPI (which embeds JSON Schema for request/response bodies), `ajv` validation, and many code generators (oapi-codegen, quicktype, json-schema-to-typescript).
Writing a schema by hand from scratch is tedious but starting from an example is fast. This tool walks a JSON value and emits the matching schema: `string` for strings, `integer`/`number` for numbers (integer when `Number.isInteger` is true), `boolean` for booleans, `object` with `properties` and `required` for objects, `array` with `items` for arrays. For arrays of objects, it merges the item schemas so the result describes the union of all keys seen.
How to Use JSON to JSON Schema Generator
Paste a JSON value (object, array, or primitive) into the input panel.
Optionally set a schema title.
Pick a draft: 2020-12 (latest) or Draft-07 (still widely used).
Toggle "Mark all properties required" and "Include examples" as needed.
Copy the generated schema.
Common Use Cases
- Generating OpenAPI request/response schemas from example payloads.
- Bootstrapping ajv or other JSON Schema validators with a known-good payload.
- Producing JSON Schema input for code generators like quicktype or json-schema-to-typescript.
- Documenting an undocumented API by capturing the response shape as a schema.
Example Input and Output
A flat JSON object generates a JSON Schema with all properties required.
{ "userId": 42, "name": "Alice" }{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"userId": { "type": "integer" },
"name": { "type": "string" }
},
"required": ["userId", "name"]
}Privacy
All conversion happens in your browser. No JSON is sent to a server.
integer vs number
JSON Schema distinguishes integer from number. The tool emits integer when the value passes Number.isInteger and number otherwise. For a value like 1.0 in a "decimal" field, this may pick integer — adjust manually if precise.

