DebuggAI Logo
DebuggAI
Free Tool

JSON Schema Generator

Free online tool to generate JSON Schema from sample data. Auto-detect types, formats, and required fields. Supports multiple schema draft versions.

  • Generate JSON Schema from sample data
  • Multiple schema draft versions (04, 06, 07, 2019-09, 2020-12)
  • Auto-detect string formats (email, date, URI, etc.)
  • Infer required fields automatically
  • Include examples from sample data
  • Download schema as JSON file
  • Copy schema to clipboard
  • Free and unlimited usage

Generated schema will appear here

How It Works

IN

Sample JSON Data

Example JSON that represents your data structure. Arrays of objects with consistent keys are ideal for inferring types and required fields.

OUT

JSON Schema

A complete JSON Schema document with inferred types, detected formats (email, date, URI), optional examples, and required field annotations.

1

Provide Sample JSON

Paste example JSON data or upload a .json file. Arrays of objects work best for inferring required fields.

2

Choose Draft Version

Select your JSON Schema draft version (2020-12, 2019-09, 07, 06, or 04) based on your tooling requirements.

3

Configure Options

Toggle "Include examples" to add sample values, and "Infer required" to automatically detect mandatory fields.

4

Generate & Download

Generate the schema, review the output, then copy to clipboard or download as a .json file.

Frequently Asked Questions

What is JSON Schema?
JSON Schema is a vocabulary that allows you to annotate and validate JSON documents. It describes the structure, types, and constraints of your data, enabling validation, documentation, and code generation.
Which schema draft version should I use?
For most modern applications, draft 2020-12 (the latest) is recommended. If you need compatibility with older tools, draft-07 is widely supported. Choose based on your tooling requirements.
How are required fields determined?
When analyzing an array of objects, fields that appear in every object (with non-null values) are marked as required. For single objects, all fields are marked as required by default.
What string formats are detected?
The generator automatically detects common formats including: email addresses, URIs/URLs, dates (ISO 8601), date-times, UUIDs, and IPv4 addresses.