JSON Schema Generator & Validator

Generate a JSON Schema (draft-07) from example JSON data, or validate any JSON document against any schema with pointed error messages. Also: JSON Formatter | JSONPath Evaluator | All JSON Tools.
All processing happens locally in your browser — nothing is uploaded.
Generate Schema Validate Data
Paste one JSON object below (or an array of objects — properties are merged and required is unioned). The schema is inferred; edit it afterwards if you need stricter rules.
Include $schema header — prepends the draft-07 declaration so validators know which dialect the schema uses. Example: "$schema": "http://json-schema.org/draft-07/schema#"
Mark required keys — adds every key found in the sample JSON to the required list. Example: "required": ["name", "price", "inStock"]
Collapse small value sets into enum — when a scalar array has 2–8 unique values, its item type is narrowed to an enum. Example: "tags": ["sale", "new", "sale"] → "tags": {"type": "array", "items": {"type": "string", "enum": ["sale", "new"]}}
Detect common string formats — recognizes ISO dates, datetimes, UUIDs, emails, and URLs and adds format. Example: "createdAt": {"type": "string", "format": "date-time"}
Generator notes: integer numbers become "integer"; strings only gain format when the format checkbox is on; several JSON objects in an array are merged (same-typed keys keep the first type, mixed types fall back to a type array; required is the union of all samples). With Validate Data, every failing rule is reported with its JSON-pointer path (e.g. .items[0].price) so you can jump straight to the offending value.
JSON Schema — a contract, not a type system

A JSON Schema describes what a valid document must look like: which keys are required, what types values have, ranges and patterns. Validation checks data against that contract; it does not transform anything. Schemas are versioned by draft — this page generates draft-07, the most widely supported dialect; 2020-12 is the current one.

A generated schema is a guess from samples — tighten required, enum and format by hand.