# JSON Schema Generator & Validator Online

> Generate a draft 2020-12 or draft-07 JSON Schema from sample JSON (types, required, nesting, formats) and validate JSON with JSON Pointer error paths. Free.

- URL: https://qilingtools.com/en/json-schema
- Category: Developer Tools (https://qilingtools.com/en/dev)
- Tags: [Developer](https://qilingtools.com/en/tags/dev), [Data Formats](https://qilingtools.com/en/tags/data)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

API docs, form validation and config files all benefit from a JSON Schema, but writing one by hand is slow and easy to get wrong. In Generate mode, paste a sample JSON document and the tool infers every field’s type (telling integer from number), nested objects and arrays, merges the fields of objects inside arrays (a field is required only if every object has it), turns mixed types into type arrays such as ["string", "null"], and detects string formats such as email, date-time, date, uri, uuid and ipv4. Optionally suggest enums for low-variety strings, include examples or disallow extra properties, and output draft 2020-12 or draft-07. In Validate mode, check JSON data against a schema with a hand-written validator that supports type, properties, required, additionalProperties, patternProperties, items and prefixItems (including draft-07 tuple syntax), enum, const, length and count limits, pattern, format, minimum / maximum / exclusive bounds, multipleOf, allOf / anyOf / oneOf / not, if / then / else, dependentRequired and $ref to #/$defs or #/definitions, including recursive references. Every error shows the JSON Pointer path in the data, a plain-language message and the schema location. Everything runs locally in your browser.

## How to use

1. In Generate, paste sample JSON and choose the draft and options
2. Copy or download the schema, or click Use for validation
3. In Validate, paste a schema and data to see every error with its path

## Features

- Infers types, required fields and nesting from sample JSON
- Merges objects in arrays; mixed types become type arrays
- Detects email, date-time, uri, uuid and ipv4 formats
- Optional enum suggestions, examples and additionalProperties: false
- Draft 2020-12 and draft-07 output
- Hand-written validator with common keywords and recursive $ref
- Errors with JSON Pointer paths and schema locations
- Runs locally, nothing uploaded

## FAQ

### Can I use the generated schema as-is?

It is a solid starting point, inferred purely from your sample: fields that never appear are not in the schema, and fields present in only some array items are not required. Generate from a varied sample, then add constraints such as minLength, pattern or enum and description text for your use case.

### What is the difference between draft 2020-12 and draft-07?

Most keywords are the same. The main differences are tuple syntax (prefixItems in 2020-12 versus array-form items plus additionalItems in draft-07), where definitions live ($defs versus definitions) and the $schema URI. OpenAPI 3.1 and most new tools use 2020-12, while some older libraries and editor plugins only understand draft-07. The validator accepts both styles.

### Are formats validated?

By default common formats are checked — email, date, date-time, time, uri, uuid, ipv4, ipv6, hostname and regex — and dates must actually exist (February 30 is rejected). The specification treats format as an annotation by default, so if your backend validator ignores formats, untick Check formats to match it.

### What is not supported?

Remote $ref (references to other files or URLs), $dynamicRef, unevaluatedProperties / unevaluatedItems and custom keywords are not supported; an unresolvable $ref is reported clearly. Your schema and data are processed only in the browser and never uploaded.

## Related tools

- [JSON Formatter](https://qilingtools.com/en/json): Free online JSON formatter: beautify or minify, validate with the exact line and column of any error, browse a collapsible tree, sort keys and escape strings.
- [Base64 Encode/Decode](https://qilingtools.com/en/base64): Free online Base64 encoder and decoder: UTF-8 safe, optional URL-safe variant, convert text to Base64 and back in real time. Processed locally, never uploaded.
- [URL Encode/Decode](https://qilingtools.com/en/url-encode): Free online URL encoder and decoder with encodeURIComponent and encodeURI modes. Escapes Chinese, spaces and special characters. Real-time and local, no upload.
- [JWT Decoder](https://qilingtools.com/en/jwt): Free online JWT decoder: decode the header and payload of a JSON Web Token, show expiry and issued-at times, all locally without uploading the token.
- [Timestamp Converter](https://qilingtools.com/en/timestamp): Free online Unix timestamp converter: convert timestamps and dates, auto-detect seconds or milliseconds, and show local, UTC, ISO 8601 and relative time.
- [Hash / Checksum](https://qilingtools.com/en/hash): Free online hash calculator: SHA-1, SHA-256, SHA-384 and SHA-512 of text or any file through the browser crypto API. Files never leave your device.
- [UUID Generator](https://qilingtools.com/en/uuid): Free online UUID generator: create RFC 4122 UUID v4 in bulk with a cryptographic RNG. Options for uppercase, no hyphens and braces, with one-click copy.
- [Base Converter](https://qilingtools.com/en/base-convert): Free online number base converter: convert between binary, octal, decimal, hexadecimal and any base 2–36. Uses BigInt for huge integers, computed locally.
