← All tools

JSON Schema Generator: Draft 2020-12 from Samples

Infer a local JSON Schema from all sample values, review nested types and required fields, and export Draft 2020-12 without pretending to validate a contract.

json-schema-generatorLOCAL WORKSPACE

Switching modes keeps the original JSON and clears results. Data stays in this page’s memory: no upload, storage or URL payload. Leaving or reloading clears it. Each mode keeps its parsing limits.

1. Enter a JSON sample

Processed only in this browser: no upload, storage or URL state. Input: 1 MiB, 100 levels, 50,000 nodes; schema: 10,000 nodes, 2 MiB; 5-second timeout.

Inference settings

Object samples at the same position require their shared keys by default. You can disallow additional properties. Review the inferred types and presence against your contract before adding formats, patterns or enums.

2. Review and adjust schema

Enter or load a sample, then generate a schema.

How to use this tool

Infer from a JSON sample, select a schema path and adjust its type or required status. Empty arrays keep unknown items; array object samples merge observed properties and intersect required keys. Export the complete schema after review.

When not to use it

Sample inference is not a complete API contract or schema validation. Formats, patterns and enums require manual review. Disable additional properties or shared required keys using the inference settings.

Read the guide →