JSON Schema Generator

Generate JSON Schema Draft 7 from any JSON object. Infers types, formats and required fields.

Frequently Asked Questions

What JSON Schema draft does this tool generate?

It generates JSON Schema Draft 7, the most widely supported version.

Does it infer string formats?

Yes — it detects date-time, date, email, and URI patterns automatically.

Can I use the output with validation libraries?

Yes. The generated schema works with ajv, zod (via coercion), and most JSON Schema validators.

Is my JSON data sent to a server?

No. Schema generation runs entirely in your browser.

What is JSON Schema?

JSON Schema is a vocabulary for annotating and validating JSON documents. A schema is itself a JSON object that describes the expected structure, types, formats, and constraints of another JSON document. It is used to:

  • Validate API request and response bodies before processing.
  • Generate TypeScript types, database models, or form schemas from a single source of truth.
  • Document API contracts in OpenAPI / Swagger specifications.
  • Power IDE autocompletion and validation for JSON config files.

JSON Schema Draft 7 Keywords

KeywordApplies toDescription
typeAllConstrains the data type: string, number, integer, boolean, array, object, null
requiredObjectArray of key names that must be present
propertiesObjectSchema for each named property
itemsArraySchema for each element in an array
enumAllValue must be one of the listed values
minimum / maximumNumberInclusive lower/upper bound
minLength / maxLengthStringMinimum / maximum string length
patternStringValue must match this regex
formatStringSemantic validation: date-time, email, uri, ipv4…
$refAllReference another schema definition (reuse)
anyOf / oneOf / allOfAllComposition: union, exclusive union, intersection

JSON Schema Validation Libraries

  • ajv (Node.js / browser) — the most popular, fastest JSON Schema validator.
  • zod (TypeScript) — defines schemas in TypeScript code; can serialize to JSON Schema via zod-to-json-schema.
  • jsonschema (Python) — reference Draft 3–7 validator.
  • Newtonsoft.Json.Schema (.NET) — most used .NET implementation.
  • json-schema-validator (Java) — Atlassian's library, widely used in enterprise Java.