๐ŸŒ EN

๐Ÿงฌ JSON Schema Generator

Paste sample JSON data to automatically infer a draft-07 JSON Schema. It detects each value's type, marks object keys as required, and merges array item schemas.

GUIDE

Learn more

01

1. What is JSON Schema

JSON Schema is a standard for describing the structure, types and constraints of JSON data. It is widely used to validate API requests/responses, check config files, and automate documentation. This tool generates a draft-07 schema draft from a single example JSON, saving you from writing one by hand from scratch.

02

2. Inference rules

Strings, integers, floats, booleans and null are mapped to the string, integer, number, boolean and null types. Objects get properties and mark every present key as required; arrays merge the schemas of all elements into items. When array elements have different keys, only keys present in every element stay required.

03

3. Refining the result

Auto-inference is only a starting point. Real schemas usually add format (email, date-time), min/max length, enum, regex pattern, and adjustments for optional fields. Large input is capped by a node limit for performance, so build a draft from a representative sample and then fine-tune the constraints.

Frequently asked questions

Which JSON Schema version is generated?
A draft-07 schema. The $schema field is set to http://json-schema.org/draft-07/schema#.
Why is every key marked as required?
A key present in the sample is inferred to always appear, so it is marked required. Remove optional fields from the required array after generation.
Is my JSON sent to a server?
No. Inference happens entirely in your browser and the data is never sent to a server.
What if array elements have different shapes?
Their schemas are merged: only common keys stay required, and mixed types become a type array (integer+number are unified to number).