{ } JSON & DATA · GENERATOR

JSON Schema Generator

Paste a JSON sample to infer a schema for its structure—objects, arrays, scalar types and field presence. Choose a JSON Schema draft and control required fields and unknown properties.

Draft 2020-12 & Draft-07 · Mixed-type inference · 100% client-side
The output is an inferred starting point, not a complete specification of every valid value.Validate JSON syntax first →
Options apply to object schemas throughout the sample.
Sample JSONLocal input · max 1 MiB
Inferred JSON Schema
Sample: 0 B
Objects: 0
Arrays: 0
Warnings: 0
Sample-based inference · Browser worker
◆ ABOUT THIS TOOL

Infer a JSON Schema from example data

Turn the shape of a JSON sample into a schema you can review and refine.

Objects & required fields

Properties are inferred from observed object keys. When enabled, a field is required only if it appears in every object sample at that location.

Arrays & mixed types

Array item schemas are inferred across observed items. Mixed types become a type union; empty arrays are left open and reported in the warnings.

Draft selection

Choose the standard JSON Schema 2020-12 or Draft-07 URI. The inferred keywords used here—type, properties, required, items and additionalProperties—work in both.

IMPORTANT

Review the schema before relying on it

A sample only shows what happened in that sample. It cannot reveal all valid values, numeric ranges, string formats, conditional rules, relationships between fields or whether an observed field is optional in other records.

For an array of objects, missing keys in any observed object stay optional when “required” is enabled. A single object sample marks each observed key as required because there is no second object to compare.

Use the additionalProperties: false option only when unknown object keys should be rejected. Leave it unchecked when your data may contain fields that were not present in the sample.

Input is limited to 1 MiB, schema depth to 128 levels and generated output to 8 MiB. Parsing and inference run in a local worker; no sample is uploaded or saved.

FAQ

Frequently Asked Questions

No. It reflects only the sample you supplied. Add rules for ranges, formats, business logic and unobserved cases yourself, then validate it against representative data.

When enabled, a property is required if it appears in every object sample at that location. With one object sample, all observed properties are marked required.

An empty array gives no evidence about its item type, so the schema leaves items unconstrained and adds a warning.

No. The sample is parsed and analyzed in a local browser worker. It is not uploaded or stored by this tool.