JSON Schema Validator
Validate JSON against a schema, or generate one
Validate JSON documents against JSON Schema (draft 2020-12 and 7) with clear error paths, or infer a schema from sample data.
- JSON
- Schema
- Validate
How to use JSON Schema Validator
- Paste a schema into JSON Schema and the data to check into JSON document, or load files with Open schema and Open JSON. Try an example loads a schema with a document that breaks several rules.
- Pick the Draft: Auto ($schema) reads the schema’s
$schema, or force 2020-12 or Draft-07. Untick Check formats (date-time, email, ipv4, uuid, uri…) to treatformatas a hint only. - Read the result: the status line says whether the document is valid, and each error lists the failing location in the document, a message and the schema path. Copy errors copies the list.
- No schema yet? Paste a sample document and press Generate schema from JSON, then edit the generated schema and use Copy schema.
How it works
Validation is done by a validator built into the tool, running in a background worker. It supports draft 2020-12 and draft-07 (draft-04 and draft-06 schemas are checked with draft-07 rules, and 2019-09 with 2020-12). Supported keywords include type, enum, const, number and string limits, pattern, items/prefixItems/additionalItems, contains with minContains/maxContains, uniqueItems, properties, patternProperties, additionalProperties, propertyNames, required, dependentRequired, dependentSchemas and dependencies, allOf, anyOf, oneOf, not and if/then/else. Every error is reported, not just the first.
$ref resolves inside the same schema: JSON Pointers such as #/$defs/address, $defs and definitions, $anchor, and $id-based references. In draft-07, keywords next to a $ref are ignored, as the spec says. String lengths count Unicode characters, so an emoji counts as one, and pattern uses JavaScript regular expressions with Unicode support and is not anchored. With format checking on, date-time, date, time, email, ipv4, ipv6, uuid and uri are checked; other formats are ignored.
Generate schema from JSON infers a schema that your sample passes. It records the types it finds, nested object properties, and array items merged across all elements. Keys present in every object are marked required, and string formats such as date-time, email or uuid are added when every value matches. Mixed types become a type list, or anyOf when objects or arrays are involved.
Limits
- Remote schemas are never fetched. A
$refto another URL or file is reported as unresolvable. unevaluatedPropertiesandunevaluatedItemsaren’t supported and are ignored with a notice.$dynamicRefis resolved like a plain$ref.- Validation is stopped after 3 seconds, for example when a
patternbacktracks catastrophically. - At most 500 errors are listed. Schemas that recurse more than 300 levels, such as a
$refloop, report an error instead of hanging. - Both inputs are read with the browser’s standard JSON parser for validation, so integers beyond 2^53 are compared after rounding. Opened or dropped files are limited to 10 MB.
- The generated schema only reflects your sample. It never adds
additionalProperties: false,enum, number ranges or string lengths.
Privacy
Validation and schema generation run entirely in your browser, in a background worker; nothing is uploaded or stored, and remote $refs are never fetched. Share copies a link with both inputs and the options in the URL’s # fragment, which browsers don’t send to servers, though anyone with the link can read it. JSON sent here from another tool with Send to… goes into the document box through this tab’s session storage and is removed as soon as it is read.
Frequently asked questions
Which JSON Schema drafts are supported?
Draft 2020-12 and draft-07. With Auto ($schema), the draft is read from the schema’s $schema and defaults to 2020-12. Draft-04 and draft-06 schemas are checked with draft-07 rules and 2019-09 with 2020-12 rules, with a notice.
Why does an invalid email pass validation?
Only when Check formats is off. The JSON Schema spec treats format as an annotation by default, so many validators skip it. With the option on, the tool checks email, date-time, date, time, ipv4, ipv6, uuid and uri.
Can my schema reference another schema file?
Not yet. $ref resolves within the pasted schema only, using $defs, definitions, JSON Pointers, $anchor or $id. References to other URLs are reported as unresolvable and are never downloaded. Copy the referenced definitions into $defs instead.
Why did validation stop after a few seconds?
A pattern like ^(a+)+$ can take exponential time on some strings. The validator runs in a worker and is stopped after 3 seconds so the page stays responsive. Simplify the pattern and validation resumes as you type.
How do I read the error paths?
The first path is a JSON Pointer into your document, such as /address/zip, or (root) for the whole document. The second is the schema keyword that failed, such as #/$defs/address/properties/zip/pattern. With $ref, it points at the referenced definition.
More tools
- Clean Image: Inspect and remove hidden image metadata
- JWT Decoder: Decode and verify JSON Web Tokens
- Diff Checker: Compare two texts line by line
- JS Runner: Run JavaScript and TypeScript in your browser
- JSON Formatter: Format, validate and minify JSON
- Encode / Decode: Base64, URL, HTML entity and hex
- Hash Generator: MD5, SHA and HMAC of any text
- UUID Generator: Generate UUID v4 and v7 in bulk
- Timestamp Converter: Unix time ↔ human dates
- Regex Tester: Test regular expressions live
- URL Parser: Break a URL into its parts
- HTTP Status Codes: Look up any HTTP status code
- MIME Type Lookup: File extension ↔ MIME type
- Password Generator: Strong random passwords and passphrases
- Random String Generator: Random tokens, IDs and keys
- Slug Generator: Turn titles into URL slugs
- Case Converter: camelCase, snake_case, Title Case and more
- Word Counter: Count words, characters and reading time
- JSON to TypeScript: Generate TypeScript types from JSON
- JSON Diff: Compare two JSON documents structurally
- JSON to SQL: Turn JSON arrays into SQL inserts
- YAML ↔ JSON: Convert between YAML and JSON
- XML ↔ JSON: Convert between XML and JSON
- CSV ↔ JSON: Convert between CSV and JSON
- CSV Viewer: View, sort and filter CSV files
- SQL Formatter: Format and beautify SQL queries
- cURL ↔ Fetch: Convert cURL commands to fetch and back
- Markdown Editor: Write Markdown with a live preview
- Text Cleaner: Remove duplicate lines, empty lines and extra spaces
- Find & Replace: Find and replace in any text
- Cron Expression Builder: Build and explain cron schedules
- User-Agent Parser: Identify browser, OS and device from a user agent
- HTTP Headers Inspector: Paste response headers and get them explained
- JWT Generator: Create and sign test JSON Web Tokens
- Certificate Inspector: Decode PEM certificates and keys
- Meta Tag Inspector: Check a page's SEO and social tags
- UTM Builder: Build campaign URLs with UTM parameters
- URL Cleaner: Strip tracking parameters from links
- Robots.txt Generator: Create and test a robots.txt file
- Sitemap Generator: Create an XML sitemap from a list of URLs
- Image Compressor: Shrink JPEG, WebP and AVIF images in your browser
- Image Resizer: Resize images by pixels, percentage or to fit a box
- Image Converter: Convert between PNG, JPEG, WebP and AVIF
- Image to Base64: Encode images as Base64 data URIs and decode them back
- SVG Optimizer: Minify and sanitize SVG files
- Favicon Generator: Make favicon.ico, Apple and Android icons from an image or emoji
- Color Converter: HEX, RGB, HSL, OKLCH and contrast checks
- Number Base Converter: Binary, octal, decimal, hex and float bits
- IP / CIDR Calculator: Subnets, masks and IP ranges for IPv4 and IPv6
- JSONPath Query: Query JSON with JSONPath expressions
- Semver Checker: Check versions against semver ranges
- chmod Calculator: Unix permissions: rwx ↔ octal
- .env Diff: Compare and validate .env files
- TOTP Generator: Generate and verify 2FA codes
- String Escaper: Escape and unescape strings for any language
- Unicode Inspector: See every character, code point and hidden symbol
- Mock Data Generator: Generate realistic fake data
- QR Code Generator: Create QR codes for links, Wi-Fi and contacts
- Lorem Ipsum Generator: Placeholder text in paragraphs, sentences or words
- Date Calculator: Date differences, business days and durations
- Unit Converter: Convert bytes, lengths, weights, temperatures and more
- Query CSV with SQL: Run SQL queries on CSV files
- PDF Merge & Split: Merge, split, reorder and rotate PDFs
- PDF Metadata Cleaner: See and remove hidden PDF metadata
- Office Metadata Cleaner: Remove author and revision data from Word, Excel and PowerPoint
- Images to PDF: Combine images into one PDF
- Image Editor: Crop, rotate, resize and adjust images
- Encrypt / Decrypt Text: Encrypt text with a passphrase (AES-GCM)
- SSH Key Generator: Generate Ed25519 and RSA SSH keys locally
- Email Header Analyzer: Trace an email's path and check SPF, DKIM and DMARC
- JSON to Code: Generate Go, Python, Rust, Java, C# and Kotlin models from JSON
- docker run ↔ Compose: Convert docker run commands to docker-compose and back
- Color Palette Extractor: Pull the dominant colours out of any image
- Password Strength Checker: How long would your password take to crack?
- SPF / DKIM / DMARC Checker: Validate and explain email DNS records
- Kubernetes YAML Checker: Validate and explain Kubernetes manifests
- .gitignore Generator: Build a .gitignore from presets
- CSP Builder: Build and check a Content-Security-Policy
- JSON-LD Generator: Create schema.org structured data
- Open Graph Image Generator: Make 1200×630 social preview images
- CSS Generator: Gradients, shadows, clamp() and more
- Time Zone Meeting Planner: Find meeting times across time zones