Converters

JSON Schema Generator

Paste a sample JSON document and get a JSON Schema that describes its structure. The generator infers types, required properties, array item schemas, and handles nested objects. The output follows the draft 2020-12 specification, so it works with any compliant validator.

JSON Schema Generator — Infer a JSON Schema (draft 2020-12) from sample JSON

What it does

  • Infers JSON Schema (draft 2020-12) from sample JSON data
  • Detects types: string, number, integer, boolean, null, array, object
  • Identifies required properties (properties present in all objects)
  • Generates array item schemas by merging item types across the array
  • Handles deeply nested objects and arrays of objects
  • Optional strict mode that makes all properties required

Use cases

  • Generating a schema for an API that doesn't provide one
  • Creating validation schemas for configuration files
  • Documenting the structure of JSON data for a team
  • Generating schemas for use with form generators or validators

How it works

1

Paste your sample JSON into the input pane

2

The tool analyzes the structure and infers types for each property

3

A JSON Schema document is generated in the output pane

4

Copy the schema for use with a validator, documentation, or form generator

Frequently asked questions

1Which JSON Schema draft does it use?

The generator produces draft 2020-12 schemas, which is the latest standard. The output uses the $schema keyword to declare the draft, so validators know which specification to follow.

2How does it handle arrays with mixed item types?

When an array contains items of different types or shapes, the generator merges them into a single schema with multiple possible types. If all items have the same structure, it generates a clean single-item schema.

3Can I make all properties required?

Yes. Toggle strict mode to mark every property as required, regardless of whether it appears in all objects. This is useful for generating strict validation schemas where no fields should be omitted.

Related tools

Use JSON Schema Generator offline in Devinity

All 95 tools run locally on your Mac. No internet required, no data sent to servers.

Download Devinity →