API Tools

JSON Schema Generator

Free online JSON Schema Generator. Automatically infer and generate standards-compliant JSON Schemas (Draft 2020-12, 2019-09, Draft-07, 06, 04) with format detection, required fields, multiple sample merging, and schema validation.

Samples:
Schema Settings & Draft Rules Schema Settings
Drop JSON file here
Supports .json, .txt with UTF-8 encoding
Input (JSON Data) JSON Input
Output (JSON Schema) Schema Draft 2020-12
Root: object
PropertiesProps: 0
Required: 0
Max Depth: 0
Time: 0ms
Draft 2020-12
Multi-Sample JSON Schema Inference

Provide 2 or more JSON samples. The engine merges discovered properties, infers optional fields, and handles nullable/union types.

JSON Schema Schema
Test JSON Instance JSON
JSON Schema Draft Specifications Comparison

JSON Schema has evolved through multiple draft versions. Below is an architectural overview of the supported drafts, their identifier schemes, and feature availability.

Specification Draft $schema URI Identifier Keyword Definitions Keyword Key Additions / Notes
Draft 2020-12 (Latest Standard) Recommended https://json-schema.org/draft/2020-12/schema $id $defs Latest standard specification. Standardizes prefixItems for tuple validation, unevaluatedProperties, and dynamic references.
Draft 2019-09 Modern https://json-schema.org/draft/2019-09/schema $id $defs Major overhaul introducing $defs, unevaluatedProperties, and separate vocabularies for core, validation, and metadata.
Draft-07 (Most Widely Supported) Industry Standard http://json-schema.org/draft-07/schema# $id definitions The most universally supported JSON Schema draft across backend SDKs, OpenAPI 3.0/3.1, Postman, and IDEs.
Draft-06 Legacy http://json-schema.org/draft-06/schema# $id definitions Introduced $id (replacing id) and boolean schemas (true / false), propertyNames, and examples array.
Draft-04 (Classic Spec) Classic http://json-schema.org/draft-04/schema# id definitions Classic specification using "id" (no dollar sign) and older schema validator conventions.
Common Schema Validation Keywords
type

Defines the valid data type(s): string, number, integer, boolean, object, array, or null.

required

An array of property names that MUST exist in the JSON object instance.

properties

A dictionary where each key represents an object property name and the value is its corresponding sub-schema.

items

Defines the schema rule applicable to all elements contained within an array instance.

additionalProperties

When set to false, strictly prohibits properties not explicitly declared under properties.

format

Semantic validation for strings, such as email, uuid, date-time, date, and uri.

Complete Guide to JSON Schema Generation

JSON Schema is an industry-standard specification for describing and validating JSON data structures. It acts as a clear contract between client applications, API endpoints, microservices, and databases. Using the PaceTools JSON Schema Generator, you can instantly turn any JSON payload or collection of sample payloads into an accurate, standards-compliant JSON Schema.

1. Paste or Upload JSON

Paste your JSON data into the editor, drag-and-drop a .json file, or click any of the pre-built sample buttons (User, Order, API Response, Product).

2. Configure Rules & Draft

Select your preferred specification draft (Draft 2020-12, Draft 2019-09, Draft-07, 06, or 04), choose required field rules, and toggle string format detection.

3. Copy, Download & Test

Copy the generated JSON Schema to your clipboard, download it as a .json file, or run live instance validation in the built-in testing tab.

Frequently Asked Questions

A JSON Schema is a standardized, declarative blueprint that defines the expected structure, data types, required properties, and validation rules for JSON payloads. Generating a JSON Schema from sample data allows developers to automate API contract validation, enforce payload security, generate automated TypeScript/Python interfaces, and produce OpenAPI / Swagger documentation.

For maximum compatibility across existing tools, libraries (like AJV 8, Python jsonschema, PHP Opis), and OpenAPI specifications, Draft-07 is the most widely adopted standard. If you are building modern microservices that require prefixItems, unevaluatedProperties, and vocabulary modularity, select Draft 2020-12.

When you provide multiple JSON payloads in the Multi-Sample tab, the generator analyzes every sample simultaneously. Fields that appear in all samples are marked as required. Fields that are missing in one or more samples are automatically classified as optional. If a field has a string in one sample and null in another, the generator produces a nullable union type.

The generator inspects string values using RFC-compliant regular expressions for common patterns, including email addresses, RFC 4122 UUIDs, ISO 8601 date-times (YYYY-MM-DDTHH:mm:ssZ), dates (YYYY-MM-DD), times (HH:mm:ss), IPv4 addresses, and URIs. You can toggle format detection on or off at any time.

Yes. Use the built-in "Schema Validator & Tester" tab to validate any JSON payload against your generated or customized schema. The engine performs real-time type checks, required field checks, format verifications, and additionalProperties enforcement, reporting exact JSON Pointer paths for any discrepancies.

Yes. All JSON parsing, schema inference, format detection, and validation logic execute 100% locally in your web browser using modern client-side JavaScript. None of your JSON payloads or generated schemas are ever sent to external servers or logged in databases.