JSON Schema Generator
Generate a JSON Schema (Draft 2020-12) from a sample JSON document. Smart format detection.
Quick answer: Generate a JSON Schema (Draft 2020-12) from a sample JSON document. Smart format detection.
Last updated
Frequently asked questions
- Why is my schema too strict?
- We infer from a single example, so every field is required and types are exact. Loosen the schema by removing keys from the <code>required</code> array or using <code>type: ["string", "null"]</code> for nullable fields.
- Which draft is the output?
- JSON Schema Draft 2020-12, the latest stable version. It's compatible with all modern validators (Ajv, JSON Schema Validator, etc.).
- Will it detect emails, URLs and dates?
- Yes — string values matching email, date-time (ISO 8601) and URL patterns get the corresponding <code>format</code> annotation.
- Are my JSON files uploaded?
- No — inference runs entirely in your browser.
- How do I infer from multiple samples?
- Generate a schema from each sample, then merge by hand (or use a tool like <code>quicktype</code>) — taking the union of properties and the intersection of required keys gives a schema that fits all samples.