JSON Schema Generator (from JSON samples)
Generate a JSON Schema (draft 2020-12, 2019-09, 07 or 04) from one or more JSON samples: types, required keys, nested objects, arrays and formats.
format is an annotation by default in 2019-09 and 2020-12 — many validators only check it when format assertion is switched on.
A JSON Schema describes what valid JSON looks like — which keys exist, their types, which are required — so APIs, config files and forms can be validated automatically. Writing one by hand for a large response is tedious. Paste one or more samples and get a schema for draft 2020-12, 2019-09, 07, 06 or 04: nested objects and arrays are described recursively, keys present in every sample become required, whole numbers become integer, and common string formats such as date-time, email, uri and uuid are detected.
How to use this tool
- Paste JSON: an array of samples, a single document, or one document per line.
- Tell the tool how the samples are arranged.
- Choose the draft your validator uses.
- Optionally add a title and $id, and choose required keys, additionalProperties: false, format detection and enums.
- Copy the schema and refine it — add descriptions, ranges and patterns that samples cannot show.
Formula
null → "null" · true/false → "boolean" · 3 → "integer" · 2.5 → "number" · "…" → "string" (+ format) · [ … ] → "array" + items · { … } → "object" + properties
Values seen at the same place are merged: integer and number become number, a value that is sometimes null gets a type list such as ["string", "null"], and objects or arrays mixed with other kinds become anyOf. A key is required only if every object at that place has it. A format is added only if every string at that place matches it and the draft defines it (date and time from draft-07, uuid and duration from 2019-09).
Example
The three sample users give an object schema with 7 properties: id (integer), email (string, format email), role (string), joined (string, format date-time — "+09:00" offsets are fine), tags (array of strings; one sample has an empty array), manager (null, seen once) and score (number, seen once). id, email, role, joined and tags are required because every sample has them; manager and score are not.
Frequently asked questions
Which draft should I choose?
Use the one your validator supports. Ajv, the most common JavaScript validator, supports 2020-12, 2019-09 and draft-07; OpenAPI 3.1 uses 2020-12; many older tools only know draft-07 or draft-04.
Why is a key not required?
At least one sample does not contain it. Add more complete samples, or edit the required list by hand.
Can I validate data against the schema here?
Yes — paste the schema and your data into the JSON Schema Validator on this site.
Is my JSON uploaded?
No. The schema is generated in your browser.
Sources
Last updated:
Page address with these inputs: https://kakao.mobile/tools/json-schema-generator/
Cite or embed this tool
kakaoCalc. (2026, November 8). JSON Schema Generator (from JSON samples). https://kakao.mobile/tools/json-schema-generator/
“JSON Schema Generator (from JSON samples).” kakaoCalc, 8 Nov. 2026, kakao.mobile/tools/json-schema-generator/.
Paste this code into your page. The widget runs in your visitors' browsers, shows no ads and keeps a link back to this page. Embedding terms