# JSON Schema Validator & Generator

> Free JSON Schema validator and generator. Validate JSON against draft-07, 2019-09 or 2020-12 with Ajv, or infer a schema from sample JSON. Private.

- URL: https://tools.crawlink.com/json-schema-validator
- Category: Developer Tools
- Price: Free, no account, no usage limits
- Privacy: Runs in your browser. The processing engine downloads once on first use, then the tool works offline. Your files never leave your device.

## What it does

Paste a JSON Schema and a JSON document to check whether the document is valid. Validation uses Ajv, the most widely used JSON Schema validator for JavaScript, with ajv-formats for email, date-time, uri and other formats; the dialect (draft-07, 2019-09 or 2020-12) is picked from the schema's $schema keyword. Every error is listed with the path to the failing value and the schema rule it broke. In Generate mode the tool infers a starting schema from sample JSON, merging array items and detecting common string formats. Everything runs in your browser.

## Features

- Ajv validator with draft-07, 2019-09 and 2020-12
- Formats: email, date, date-time, uri, uuid, ipv4 and more
- All errors at once with instance and schema paths
- Schema generator with merged array items and format detection
- Options: all fields required, no extra properties
- JSON never leaves your browser

## How to use

1. Choose Validate, paste your schema on the left and your JSON on the right.
2. Read the result: Valid, or each error with its JSON path and the rule that failed.
3. To create a schema, switch to Generate and paste sample JSON.
4. Pick the draft and options, then copy the schema or use it to validate.

## FAQ

### What is JSON Schema?

JSON Schema is a JSON vocabulary for describing the shape of JSON data: which properties an object has, their types, which are required, string formats, number ranges and so on. It is used to validate API requests and responses, configuration files and form data, and OpenAPI uses it to describe request and response bodies.

### Which draft should I use?

Use 2020-12 for new schemas; it is the current version and the one OpenAPI 3.1 aligns with. Draft-07 is still very common in existing tools. Set the version with the $schema keyword, for example "$schema": "https://json-schema.org/draft/2020-12/schema". Draft-04 is not supported here.

### Why does my invalid email still pass?

In JSON Schema, format is an annotation by default, and validators only enforce it when format validation is switched on. This tool enables it with ajv-formats, so "format": "email" is checked here, but your own server-side validator may need the same setting.

### How accurate is the generated schema?

It describes the sample you give it, so it is a starting point rather than a finished contract. Values that happen to be integers become "integer", optional fields look required unless they are missing from some array items, and enums or ranges are not guessed. Review and tighten it before use.

### What does additionalProperties: false do?

It makes the object reject any property not listed under properties. That catches typos and unexpected fields, but it also breaks forward compatibility when new fields are added, so use it deliberately.

### Is my data uploaded?

No. Ajv is downloaded once from a CDN and runs in your browser; your schema and JSON stay on your device.

Also searched as: json schema validator, json schema generator, validate json schema, json schema online, generate json schema from json, ajv validator online, json schema draft 2020-12.

## Related tools

- [JSON Formatter](https://tools.crawlink.com/json-formatter): Format, validate and minify JSON
- [JSONPath Tester](https://tools.crawlink.com/jsonpath-tester): Test JSONPath expressions on your JSON with live matches, paths and pointers
- [JSON to Code](https://tools.crawlink.com/json-to-code): Generate TypeScript, Zod, Go, Python or SQL from JSON
- [JSON Diff](https://tools.crawlink.com/json-diff): Compare two JSON documents by path and value
- [Data Format Converter](https://tools.crawlink.com/data-converter): Convert between CSV, JSON, YAML, XML and SQL

---
Part of Tools by Crawlink — https://tools.crawlink.com/ · All tools: https://tools.crawlink.com/llms.txt
