JSON to JSON Schema Generator
Paste sample JSON and get a JSON Schema — types, required fields and formats inferred automatically.
Output
Draft
JSON sample
JSON Schema
Paste sample JSON and get a JSON Schema — types, required fields and formats inferred automatically.
Output
Draft
JSON sample
JSON Schema
In short: A JSON to JSON Schema generator reads sample data and writes the schema that describes it — types, required keys, nested objects, arrays and string formats. Paste one document or an array of examples and RealJSON infers a schema you can drop into your API contract, validator or form builder.
Writing a JSON Schema by hand is slow and error-prone. Starting from real data is faster: this tool derives a first draft in one click, which you then tighten with constraints such as minimum, pattern or enum.
Supply several samples (as an array) to get realistic output — keys that appear in every sample become required, and fields that are sometimes null become type unions.
Strings, numbers, integers, booleans, nulls, objects and arrays — including arrays of objects, which become an items schema.
A key is required only if it appears in all samples (and can be turned off with "Mark keys required").
Values that look like ISO dates, timestamps, emails, UUIDs, URLs and IPv4 addresses get a format annotation.
Enable additionalProperties: false to reject unknown keys.
The "LLM structured output (strict)" mode emits what OpenAI strict: true, Anthropic structured outputs and Gemini accept: an object root, additionalProperties: false everywhere, every property in required with optional fields made nullable, and no unsupported keywords. Check model responses against it with the JSON Schema Validator and fix malformed ones with JSON Repair.
Paste a sample document or an array of samples. RealJSON infers types for every field, marks keys required when they appear in every sample, detects formats such as date-time, email and uuid, and outputs a ready-to-use schema.
You can emit Draft 2020-12, Draft 2019-09 or Draft-07. The generated keywords (type, properties, required, items, format, additionalProperties) are valid in all three.
Items are merged into one schema: a key missing from some items is left out of "required", and fields whose type varies become a type union such as ["string", "null"].
Yes — open the JSON Schema Validator, paste the schema and your data, and every violation is listed with its JSON pointer path.
Yes. Switch Output to "LLM structured output (strict)". The schema then follows strict-mode rules: an object at the root, additionalProperties: false on every object, every property listed in required (fields missing from some samples become nullable instead), items on every array and only supported formats. Paste it into response_format / json_schema with strict: true, a tool input_schema for Claude, or responseJsonSchema for Gemini.
No. Schema inference runs entirely in your browser, so API responses and private payloads never leave your device.
JSON Schema Validator · JSON to TypeScript · JSON to Zod · JSON Generator
Browse all free JSON tools →