devpocket.dev

JSON to JSON Schema

Infer a draft 2020-12 JSON Schema from one JSON value or an array of samples.

Runs locally
Loading tool…

How to use

Paste one JSON value, or paste a top-level array to treat each element as a separate sample. The generator merges observed types, infers object properties recursively, and marks a key required when every sample object contains it. It also recognizes conservative date-time, email, URI, and UUID strings.

Enable All properties required to require every observed key, No additional properties for closed objects, or Add examples to retain representative values. Inference describes the samples you provide; review it before using it as an API contract.

FAQ

How do I provide multiple samples?

Use a top-level JSON array. Each array element is treated as one sample for the root schema.

How are required properties inferred?

By default, a property is required only when it appears in every object sample at that level. The all-required option overrides this.

Will it infer numeric ranges or regex patterns?

No. The tool avoids guessing constraints that a small sample cannot justify. It focuses on types, shape, required keys, formats, and examples.

Related tools