The JSON Schema Generator automatically produces a JSON Schema (Draft-07) from any JSON example you provide. Paste a JSON object and get a complete schema describing its structure: property types, required fields, nested objects, arrays, and primitive types.
JSON Schema is used to validate API request and response bodies, document data structures, configure form validation, generate TypeScript types, and enforce data contracts between services.
The generated schema marks all keys present in the example as required. Edit the output to mark optional fields and add additional constraints like minimum, maximum, pattern, and enum.
Everything runs in your browser. Your data never leaves your device.
Paste a JSON example into the input panel.
A JSON Schema is generated instantly based on the structure and types.
Copy the schema and use it in your application, API validator, or documentation.
Writing a JSON Schema by hand from scratch means carefully typing out every property, type, and required field — tedious and error-prone for anything beyond a few fields. Generating one from a real example instead gives you a complete, accurate starting point in seconds, based on the actual data your system produces.
The generated schema is a starting point, not a finished product: it marks every observed field as required and infers types from a single example, so you'll typically want to review it, relax fields that are genuinely optional, and add constraints like enum, pattern, or minimum/maximum that a single example can't reveal.
Draft-07, which is the most widely supported version across libraries, tools, and frameworks.
Yes — all keys present in the example are added to the required array. Remove any properties that are truly optional from the required list in the generated schema.
Yes — integers (whole numbers) generate integer type, decimals generate number type, and strings generate string type. Booleans and null are also detected.
Yes — nested objects generate nested schema definitions with their own properties and required arrays. Arrays generate an items definition based on the first array element.
The generated schema is standard JSON Schema Draft-07 compatible with Ajv. For Joi and Yup, you would need to manually translate the schema to their specific API.
The generated JSON Schema Draft-07 output is compatible with OpenAPI 3.1, which uses standard JSON Schema. For OpenAPI 3.0, you may need to adjust minor syntax differences, since 3.0 uses a JSON Schema subset.
Remove the field's name from the required array in the generated schema. All fields present in your example are marked required by default, since the generator can't know which ones are truly optional from a single example.
Paste a single representative object rather than an array for the clearest schema. If you paste an array, the generator will typically produce a schema based on the array's own shape rather than the individual items.