ZenovayTools

JSON Schema Generator

Generate JSON Schema definitions from sample JSON data with automatic type inference, required field detection, and Draft 2020-12 support.

Options

JSON Schema type inference reference
Sample valueInferred typeNotes
"hello"stringPlain text
"alice@example.com"stringformat: email
"https://example.com"stringformat: uri
"2024-03-15"stringformat: date
"2024-03-15T08:30:00Z"stringformat: date-time
"3fa85f64-..."stringformat: uuid
42integerWhole numbers
3.14numberDecimal numbers
true / falseboolean
nullnull
[...]arrayItems schema merged from all elements
{...}objectRecursive — produces nested properties

How to Use JSON Schema Generator

  1. 1Paste or type your sample JSON data.
  2. 2Select the JSON Schema draft version.
  3. 3Click Generate to infer the schema.
  4. 4Copy the generated schema for use in your project.
Zenovay

Privacy-first analytics for your website

Understand your visitors without invasive tracking. GDPR compliant, lightweight, and powerful.

Explore Zenovay

Frequently Asked Questions

What is JSON Schema?
JSON Schema is a vocabulary that allows you to annotate and validate JSON documents. It describes the structure, types, and constraints of a JSON value using a JSON document itself. JSON Schema is widely used for validating API request and response payloads, configuration files, and any data interchange format based on JSON. A schema document describes what values are valid — for example, specifying that a field must be a string, a number within a range, or an object with certain required properties.
What are the differences between JSON Schema Draft 2020-12 and Draft-07?
Draft 2020-12 is the most recent stable specification and introduces several improvements: "prefixItems" replaces "items" for tuple validation, "$dynamicRef" and "$dynamicAnchor" replace "$recursiveRef", vocabulary declarations are first-class, and "unevaluatedProperties"/"unevaluatedItems" keywords were refined. Draft-07 (2018) is older but extremely well-supported across libraries in every language and is the de facto standard for OpenAPI 3.0 schemas. If you need maximum compatibility with existing tools, choose Draft-07. If you are starting a new project with up-to-date tooling, choose Draft 2020-12.
What validation keywords does JSON Schema support?
JSON Schema provides keywords for every validation need: type (string, number, integer, boolean, null, array, object), required (list of mandatory property names), properties (per-property sub-schemas), minLength/maxLength (string length), minimum/maximum/exclusiveMinimum/exclusiveMaximum (numeric ranges), pattern (regex for strings), enum (allowed values list), const (exact value), minItems/maxItems (array size), uniqueItems (array uniqueness), additionalProperties (controls extra keys), oneOf/anyOf/allOf/not (boolean combinators), $ref (schema references), and many more. The full Draft 2020-12 specification is at json-schema.org.
What do JSON Schema generators do, and what are their limitations?
A JSON Schema generator infers a schema from one or more sample JSON values. It determines the type of each field, marks all observed properties as required, and recurses into nested objects and arrays. The main limitation is that a single sample cannot represent optional fields, union types, conditional constraints, or value ranges — those must be added manually. For production schemas, treat generated output as a starting point and refine it: mark truly optional fields, add minimum/maximum for numbers, add pattern for strings with a fixed format (email, UUID, date), and remove properties from required that may be absent.
What are common use cases for JSON Schema?
JSON Schema is used to: (1) validate API request bodies and response payloads in REST APIs and GraphQL — many frameworks (FastAPI, Fastify, Spring, .NET, Go gin) accept a schema and reject invalid data automatically; (2) validate configuration files — tools like VS Code use JSON Schema to provide IntelliSense for JSON and YAML config files; (3) generate TypeScript types or Python dataclasses via tools like quicktype; (4) document API contracts alongside OpenAPI/Swagger specifications; (5) enforce data quality in data pipelines — Apache Kafka, AWS EventBridge, and others support schema registries backed by JSON Schema.