JSON Schema Generator

Generate JSON Schema from sample JSON data. Infers types, detects formats (dates, emails, URIs, UUIDs), and supports Draft 2020-12, Draft-07, and Draft-04.

Your data never leaves your browser Available via MCP

How to Use

  1. Paste your JSON data into the Input JSON panel.
  2. Select the JSON Schema draft version you want to target.
  3. Click Generate Schema to create the schema.
  4. Copy the generated schema and refine it for your project.

What Is JSON Schema?

JSON Schema is a declarative language for describing the structure of JSON data. It enables validation, documentation generation, and code generation from a single source of truth. Major API frameworks like OpenAPI 3.x use JSON Schema as their data type system, making it essential for modern API development.

Format Detection

This tool automatically detects common string formats in your data: ISO 8601 date-times, date strings, email addresses, URIs, and UUIDs. These are annotated with the appropriate format keyword, enabling validators to perform semantic checking beyond simple type validation.

Array Schema Merging

When your JSON contains arrays of objects, the tool merges schemas across all array elements. Fields present in every element are marked as required; fields missing from some elements become optional. This produces accurate schemas even from heterogeneous sample data.

Related Tools

Validate JSON syntax with the JSON Validator. Validate data against an existing schema with the JSON Schema Validator. Format JSON with the JSON Formatter. Generate TypeScript interfaces from JSON with JSON to TypeScript. Compare JSON objects with the JSON Patch / Diff tool.

Frequently Asked Questions

What is JSON Schema?
JSON Schema is a vocabulary for annotating and validating JSON documents. It describes the structure, types, and constraints of JSON data, enabling automated validation, documentation, and code generation.
How does schema inference work?
The tool analyzes your JSON data and infers types for each field. Objects become "object" types with properties, arrays get "items" schemas (merged across all elements), and primitives are typed as string, number, integer, or boolean. Common formats like dates, emails, URIs, and UUIDs are auto-detected.
Which JSON Schema draft should I use?
Draft 2020-12 is the latest and most feature-rich. Draft-07 has the widest tooling support and is recommended for most projects. Draft-04 is for legacy systems only.
Is the generated schema production-ready?
The generated schema is a strong starting point based on your sample data. You should review and refine it — add descriptions, tighten constraints (minLength, pattern, enum values), and adjust required fields based on your actual data model.
Is my data safe?
Yes. All schema generation happens entirely in your browser. No data is sent to any server.

Use this tool from AI agents. The CodeTidy MCP Server lets Claude, Cursor, and other AI agents use this tool and 46 others directly. One command: npx @codetidy/mcp

Drop file to load