JSON Schema Generator

Build JSON schemas visually infer structures from examples validate sample data configure advanced rules and export production ready schemas directly in your browser quickly

Generated Schema Result

Ready
1

Generation Settings

JSON Schema

Generate From Sample JSON

Paste JSON data or import a file.

Visual Property Builder

Edit Existing JSON Schema

Live sync

Advanced Root Rules

Schema Presets

JSON Data Validation

Not tested

No 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 valueDetected schemaOptional validationExample
TextstringminLength maxLength pattern format"john@example.com"
Whole numberintegerminimum maximum multipleOf30
Decimalnumberminimum maximum exclusive bounds19.95
True or falsebooleanconst enumtrue
Objectobjectrequired additionalProperties dependencies{"name":"John"}
Listarrayitems minItems uniqueItems contains["a","b"]
Nullnullnullable union typenull

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.


Related Calculators

Password GeneratorUsername GeneratorUUID/GUID GeneratorQR Code GeneratorBarcode GeneratorFake Email Address GeneratorAPI Key Generator (mock/testing)Regex GeneratorLorem Ipsum GeneratorRandom IP Address Generator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.