API response object
Infer property types, required fields, and nested object constraints from a single payload sample.
Processed locally
Generate JSON Schema Draft 2020-12 locally from JSON sample(s) with primitive and complex type inference, required field controls, format detection, and diagnostics.
Overview
JSON to JSON Schema Generator infers valid JSON Schema Draft 2020-12 documents locally from JSON sample objects or arrays. It supports single and multi-sample analysis, conservative format detection, configurable required fields and additionalProperties policies, and self-validates samples against the generated schema without network uploads.
Workflow
Follow the core workflow below. Use “Show in tool” to locate the real control in the live tool above.
Use Single sample for one representative payload, or open Multiple samples to infer optional fields and shared structure across examples.
Single sampleMultiple samplesOpen Multiple samples to add representative payloads and distinguish fields that are always present from fields that are optional.
Multiple samples+ Add samplePaste a representative JSON value. In Multiple samples mode, add up to five examples of the same payload shape.
JSON sample+ Add sampleLoad sampleSet required-field behavior, additional-properties policy, and optional conservative format inference before generating the schema.
Required fieldsAdditional propertiesInfer common string formatsInclude examplesGenerate a Draft 2020-12 schema locally from the supplied samples.
Generate SchemaCheck optional fields, unions, empty structures, inferred formats, and confirm that every provided sample validates against the generated schema.
DiagnosticsSample self-validationWarningsReview the schema, then copy it or download a .schema.json file for validation, tests, or documentation.
Copy SchemaDownload .schema.jsonYou have generated a standard JSON Schema Draft 2020-12, verified sample self-validation, and exported your schema locally.
Copy SchemaDownload .schema.jsonPractical cases
Infer property types, required fields, and nested object constraints from a single payload sample.
Compare two samples to automatically detect optional fields when a property is omitted in one payload.
Infer nullable type arrays when a property contains null in one sample and a string in another.
Generate anyOf or type arrays when array elements contain mixed primitive or object types.
Receive diagnostic warnings when empty structures leave item or property types underdetermined.
Troubleshooting
From evidence to action
Review the inferred schema first, then use the generated JSON Schema directly in validation, documentation, tests, or a coding-agent workflow. Inference describes the samples you provided; it does not discover hidden business rules.
Developer guides
Understand the concept, inspect a testable example, then open it in the tool above.
FAQ