JSON Schema Generator & Validator

Create a JSON Schema from an example document, or check a JSON document against a schema and see exactly which values break which rules.

Sample JSON
Generated schema

What JSON Schema is for

A JSON Schema describes what a valid document looks like: which fields exist, their types, which ones are required and what values are allowed. Teams use it to document APIs (OpenAPI uses it for request and response bodies), to validate input on a server, and to catch bad test data before it reaches production.

Generating a schema from an example

Paste a real response or config file and the generator writes a draft 2020-12 schema:

A generated schema is a starting point. Tighten it by hand, for example with minimum, maxLength, enum or pattern, before relying on it.

Validating JSON

Switch to Validate JSON, paste a schema and a document, and every problem is listed with the path of the value, a plain explanation and the rule that failed, for example $.orders[0].qty: "0 is less than the minimum 1".

Supported keywords: type, enum, const, properties, required, additionalProperties, patternProperties, propertyNames, minProperties/maxProperties, dependentRequired, items, prefixItems, additionalItems, contains, minItems/maxItems, uniqueItems, minLength/maxLength, pattern, format, minimum/maximum and their exclusive forms, multipleOf, allOf, anyOf, oneOf, not, if/then/else and $ref within the same schema.

For production use, validate in your application with a full implementation such as Ajv (JavaScript), networknt json-schema-validator (Java) or jsonschema (Python). This page is for quick checks while you work.

Frequently asked questions

Which JSON Schema drafts are supported?

The generator writes draft 2020-12. The validator understands the common keywords of draft 4, 6, 7, 2019-09 and 2020-12, including $ref to definitions inside the same schema. References to other files or URLs are not followed.

How does the generator decide which fields are required?

A field is required when it appears in every example of that object. If you paste an array of objects and one item lacks a field, that field stays optional. You can switch required fields off entirely.

Why is my date or email not detected?

Formats are guessed from the sample values: ISO 8601 dates and times, email addresses, http(s) URLs and UUIDs. Other values stay plain strings. You can add or remove a format in the generated schema by hand.

Is my data sent anywhere?

No. Generating and validating both run in your browser. Your inputs are kept in this browser's local storage so they survive a refresh.