JSON Schema Generator + Validator — Free Online
Free JSON Schema generator and validator — infer Draft-07 schema from a sample, or validate JSON against a schema with full error pointers. AJV-powered.
Two tools in one. Generate mode infers a Draft-07 JSON Schema from any sample — required fields, types, recursive structure, mixed-type arrays as anyOf. Validate mode runs your JSON against an existing schema using AJV (the industry-standard validator) and lists every violation with its path and the failed keyword.
Want TypeScript types instead? JSON to TypeScript generates interfaces from the same kind of input. Need to clean the sample first? JSON Formatter validates and pretty-prints.
How to Generate JSON Schema
Pick a mode
Generate creates a Draft-07 schema from a sample JSON. Validate checks any JSON against an existing schema and reports each error with its path.
Paste your JSON
For Generate, paste a representative sample. For Validate, paste both the JSON to check AND the schema to check it against.
Click and read
Generate emits the inferred schema in the right pane. Validate either confirms the data is valid (green banner) or lists every error with its path, keyword, and message.
When Do You Need a JSON Schema?
Validating user input: Reject malformed payloads before they touch your business logic. AJV with a JSON Schema is the de facto standard for Node.js validation.
OpenAPI specs: Every request and response in OpenAPI 3.x is described by a JSON Schema. Generate the body schema in one click instead of typing it.
Form generation: Tools like react-jsonschema-form render UI directly from a schema. Generate the schema from a sample of valid data, get a free admin form.
Contract testing: Snapshot a known-good API response as a schema, then assert every future response matches. Catches breaking changes automatically.
Why Use PDFFlare for JSON Schema?
Recursive Structure
Nested objects produce nested schemas. Required fields are declared at every level. Arrays infer item types.
Mixed-Type Arrays
Arrays of mixed types use `anyOf` — you get a faithful schema instead of a wrong-but-simple one.
100% Browser-Based
Sample data stays on your device. Safe for production payloads.
No Signup Required
No account, no rate limits. Open, paste, generate, copy.
Frequently Asked Questions About JSON Schema
It runs your JSON against a JSON Schema you provide and reports every violation — type mismatches, missing required fields, pattern failures, format errors, etc. Each error shows the path (e.g. /users/2/age), the keyword that failed, and a human-readable message.
AJV — the industry-standard JSON Schema validator for JavaScript. AJV is loaded lazily, so its bundle weight only hits users who actually click Validate. Supports Draft-07, Draft 2019-09, and Draft 2020-12 (set $schema in your schema to switch).
Draft-07 — the most widely-supported draft across validation libraries (AJV, OpenAPI 3.0+, Zod converters, etc.). The output declares $schema as 'http://json-schema.org/draft-07/schema#'.
Yes. Every property present in the sample is added to the 'required' array of its parent object. If a field is optional in your domain, remove it from the required list after generation.
Each item in the array is inspected; the schema's 'items' property holds the structural type. Arrays of mixed types use 'anyOf' to express the union — you can simplify post-hoc if appropriate.
Speed and accuracy. Walking even a moderately-sized API payload to write a schema by hand is tedious and error-prone. Generate-then-tweak is much faster and harder to get wrong on basic structure.
Yes. Nested objects produce nested schemas via 'properties'. Each level marks its own 'required'. Recursion handles arbitrary depth.
No. Both Generate and Validate run entirely in your browser. Your sample data and your schema both stay on your device.