Generated Schema Result
ReadyGeneration Settings
JSON SchemaGenerate From Sample JSON
Visual Property Builder
Edit Existing JSON Schema
Live syncAdvanced Root Rules
Schema Presets
JSON Data Validation
Not testedNo validation has run yet.
Formula used
The generator maps each JSON value to its JSON Schema type. Objects become object schemas and their keys become properties. Arrays infer an item schema from their values. Strings can receive format rules when recognizable patterns appear. Numeric values become integer or number types. Required fields are added when that option is enabled. Advanced constraints are merged into the generated schema after inference.
How to use this calculator
Paste example JSON and select the schema draft you need. Choose whether examples formats defaults or required fields should appear. Press Infer Schema to create a starting schema automatically. Open Visual Builder to change property types and constraints. Use Advanced Root Rules for reusable definitions and conditional logic. The Raw Schema Editor accepts an existing schema for direct editing. Paste test data into the validation section. Press Validate JSON to check data against your current schema. Export the result when the schema behaves as expected.
Example data table
| JSON value | Detected schema | Optional validation | Example |
|---|---|---|---|
| Text | string | minLength maxLength pattern format | "john@example.com" |
| Whole number | integer | minimum maximum multipleOf | 30 |
| Decimal | number | minimum maximum exclusive bounds | 19.95 |
| True or false | boolean | const enum | true |
| Object | object | required additionalProperties dependencies | {"name":"John"} |
| List | array | items minItems uniqueItems contains | ["a","b"] |
| Null | null | nullable union type | null |
JSON Schema guide
JSON Schema describes the structure and rules expected from JSON data. A schema can require fields and restrict values without changing data. Each property can define a type and specific validation keywords. String rules include length limits regular expressions and recognized formats. Numeric rules include ranges exclusive bounds and divisibility constraints. Array rules can control length uniqueness contents and positional items. Object rules can restrict property counts names dependencies and unknown fields.
Modern drafts support reusable definitions through the $defs keyword. References use $ref to reuse those definitions across a schema. Composition keywords combine or compare multiple schemas for flexible validation. The allOf keyword requires every listed schema to pass. The anyOf keyword requires at least one schema to pass. The oneOf keyword requires exactly one schema to pass. The not keyword rejects values matching its nested schema.
Conditional validation uses if with optional then and else rules. This helps when requirements depend on another property value. Pattern properties apply rules to keys matching regular expressions. Dependent requirements can require companion fields when another field exists. Unevaluated properties and items provide stricter control in modern drafts. Older drafts support fewer keywords and may use different structures.
This tool keeps schema generation inside your browser whenever possible. Your pasted JSON does not need remote processing for normal use. The built-in validator supports common structural composition and dependency keywords. Complex external references are not fetched from the internet. Local references under the current schema can still be resolved. Always test important production schemas with your deployment validator too.
Use generated examples as a starting point rather than final policy. Inference can identify types but cannot know every business requirement. Add realistic ranges patterns enumerations and dependency rules where needed. Keep descriptions clear because schemas often become API documentation. Prefer reusable definitions when several properties share the same structure. Validate both expected examples and deliberately invalid examples before deployment.