JSON to JSON Schema Converter

Generate JSON Schema from your JSON data automatically

JSON Input

Paste your JSON data here

Example JSON

Click to load example JSON data

JSON Schema Output

Generated JSON Schema

Schema Features

Type Inference
Automatically detects string, number, boolean, null, object, and array types
Nested Objects
Handles deeply nested objects and generates proper schema structure
Array Support
Detects array item types and handles mixed-type arrays with anyOf
Required Fields
Optionally marks all present fields as required in the schema

About JSON Schema

What is JSON Schema?

JSON Schema is a vocabulary that allows you to annotate and validate JSON documents. It describes the structure, data types, and constraints of your JSON data, making it easier to validate, document, and generate code from your APIs.

Schema Structure

$schema: Specifies the JSON Schema version being used
type: Defines the data type (string, number, object, array, boolean, null)
properties: Describes the properties of an object
required: Lists which properties must be present
items: Defines the schema for array elements

Common Use Cases

  • API documentation and validation
  • Data validation in web forms
  • Configuration file validation
  • Code generation from schemas
  • Database schema documentation
  • Contract testing between services
  • IDE autocomplete and IntelliSense

Supported Data Types

string
Text values
number
Numeric values
boolean
true/false
object
Key-value pairs
array
Ordered lists
null
Null values

Schema Versions

This tool supports both JSON Schema Draft 07 (widely used) and Draft 2020-12 (latest). Draft 07 is recommended for maximum compatibility with existing tools and libraries. Draft 2020-12 includes new features like unevaluatedProperties and prefixItems.