JSON Schema Generator
Paste a JSON sample and get a JSON Schema, with property types, array items, required fields, and string formats inferred for you.
The schema is generated live as you type. Nothing leaves your browser.
Draft version
Required properties
Options
JSON Schema
How to generate a JSON Schema online
Paste your JSON
Drop a JSON object, array, or value into the input and the matching schema appears live as you type.
Pick a draft
Choose Draft-07, 2020-12, or Draft-06 so the schema targets the validator you use.
Refine the rules
Decide whether observed properties are required, whether extra properties are allowed, and whether to include examples.
Copy the schema
Copy the generated JSON Schema to your clipboard or download it as a .json file.
Why use this tool
Full structure inference
Every object becomes a properties block with typed fields, nested objects recurse, and integers are told apart from floating-point numbers.
Merged array items
All elements of an array are merged into a single item schema. When they differ, the result becomes a union so mixed lists validate cleanly.
Nullable and empty handling
A null value widens a type to allow null, an empty object stays an open object, and an empty array keeps unconstrained items.
String format detection
Strings that all match one pattern get a format such as email, uri, date-time, date, uuid, or ipv4, while mixed strings stay plain.
Draft and strictness options
Switch between draft versions, mark observed keys required or optional, toggle additional properties, and add example values.
Runs entirely in your browser
Everything happens on your device. Nothing is uploaded, so private payloads and API responses stay local.
About this tool
This tool turns a JSON sample into a JSON Schema. Paste an object, an array, or a bare value, and it walks the structure to describe it: objects become a properties block with a typed schema per field, nested objects recurse into their own blocks, and primitives map to string, number, integer, or boolean. The schema updates live as you edit, so you can shape it against real data instead of writing it by hand.
It is built for the messy parts of real payloads. The elements of an array are merged into one item schema, and when they disagree the result becomes a union rather than guessing a single shape. A null value widens the type to allow null instead of being dropped, an empty object stays open, and an empty array keeps its items unconstrained. Strings are checked for a shared format, so a field of email addresses or date-time stamps is annotated while a field of free text stays a plain string. You choose the draft version, whether observed keys are required, whether extra properties are allowed, and whether to include example values.
It fits alongside the rest of your JSON workflow. Tidy a raw payload first with the JSON formatter, turn the same sample into typed code with JSON to TypeScript, or round-trip a config through JSON to YAML. Because the whole thing runs in your browser, response bodies that name internal services or tokens never leave your machine.
Frequently asked questions
- How does it infer the schema?
- It reads your JSON sample and derives the shape from the values it finds. Objects become properties blocks, arrays become item schemas, and primitives map to string, number, integer, or boolean. The output updates live as you edit the input.
- How are arrays with mixed items handled?
- Every element of an array is merged into a single item schema. If the elements share a shape they collapse into one, and if they differ the item schema becomes a union that covers each kind, so a heterogeneous list still validates.
- How are null and empty values treated?
- A null value widens the surrounding type to also allow null, rather than being ignored. An empty object is described as an object with no fixed properties, and an empty array is described as an array whose items are unconstrained.
- Which string formats are detected?
- When every string at a position matches the same pattern, the field is annotated with a format such as email, uri, date-time, date, time, uuid, or ipv4. If the strings are mixed or plain text, no format is added.
- Which draft versions are supported?
- You can target Draft-07, 2020-12, or Draft-06. The tool sets the matching schema identifier and keeps the rest of the output compatible across those drafts.
- Is my data uploaded anywhere?
- No. Everything runs in your browser. Your JSON never leaves your device, is never sent to a server, and is not stored or logged.
Related tools
JSON to TypeScript
Paste JSON and get typed TypeScript interfaces, with nested objects, arrays, optional fields, and null handled for you.
JSON Formatter & Validator
Pretty-print, minify, or explore JSON as a collapsible tree, with syntax errors shown inline.
JSON to YAML
Convert JSON to YAML and YAML back to JSON, in both directions, with your choice of indentation.
API Key Generator
Generate cryptographically random API keys and tokens in hex, base62, or base64url, with control over length, an optional prefix, and bulk output.
ASCII Table Reference
The full ASCII character set with decimal, hex, octal, binary, and HTML codes. Search by code, character, or name.
Atbash Cipher
Mirror the alphabet so A swaps with Z, B with Y, and so on. Atbash is its own inverse, so one field both encodes and decodes as you type.