JSON Schema Generator

Generate JSON Schema from sample JSON data

Hur man använder

Paste or type your JSON into the input area. A JSON Schema (Draft 2020-12) is generated instantly, detecting types for strings, numbers, integers, booleans, null, arrays, and objects. String values are checked for common formats like email, URI, UUID, IPv4, and ISO date-time. Use the options panel to toggle whether all properties are required, allow additional properties, or add a title and description to the root schema. Switch to the Validate tab to test sample JSON against the generated schema and see pass/fail results with error details. Copy or download the schema for use in API definitions, code generation, or data validation.

Exempel

API response modeling

Paste a sample API response to generate a schema that documents the expected shape. Use the schema for request/response validation in your API gateway or test suite.

Configuration file validation

Paste your app config JSON to produce a schema, then validate other config files against it. Catches typos, missing keys, and wrong types before deployment.

Database document structure

Paste a sample MongoDB or Firestore document to generate a schema that captures the expected structure, including nested objects and arrays of objects.

Vanliga frågor

Which JSON Schema draft does this use?

The generated schema targets Draft 2020-12, the latest stable version. It uses the $schema keyword to declare compliance. The output is compatible with most validators that support 2020-12 or later.

How does format detection work?

String values are checked against patterns for ISO 8601 date-time, email addresses, UUIDs (RFC 4122), IPv4 addresses, and URIs. When a match is found, the corresponding format keyword is added to the schema property.

How are arrays handled?

The schema for array items is inferred from the first element. If the array is empty, items default to string type. For arrays of objects, the first object is used to generate the items schema with all its nested properties.

What does the validation tab do?

It checks whether a JSON document conforms to the generated schema. It verifies types, required properties, additional properties restrictions, array item types, and format constraints. Errors show the exact path of each violation.

Skickas mina data till en server?

No. Schema generation and validation run entirely in your browser using JavaScript. No data leaves your machine.

Om det här verktyget

Paste JSON and instantly generate a JSON Schema with type detection, format inference, and validation. Supports nested objects, arrays, and Draft 2020-12.

Alla beräkningar utförs lokalt i din webbläsare. Din data lämnar aldrig din enhet.