Generate a JSON Schema (draft 2020-12 or draft-07) from a JSON document as you paste, with detected formats and a check that your document validates.
Initializing in your browser…
Format, validate and minify JSON, JSONC or JSON5 as you paste, with exact numbers, precise error locations, a tree view, JSONPath queries and schema checks.
Generate 5-7-5 haiku from nine themes or your own words, with every syllable counted from a pronouncing dictionary, plus line shuffles, saving and image export.
Build Markdown tables in an editable grid or paste them from a spreadsheet or CSV, with column alignment, escaped pipes and neatly padded output.
You are adding validation to an order webhook and want a schema that matches the payloads your shop already sends.
Sample payload
{
"orderId": 12345678901234567890,
"customer": { "email": "ada@example.com", "since": "2024-01-15T10:30:00Z" },
"lines": [
{ "sku": "A-1", "qty": 2, "note": "gift wrap" },
{ "sku": "B-7", "qty": 1 }
]
}Generated schema (draft 2020-12, shortened)
"orderId": { "type": "integer" }
"customer": { "type": "object",
"properties": {
"email": { "type": "string", "format": "email" },
"since": { "type": "string", "format": "date-time" } },
"required": ["email", "since"] }
"lines": { "type": "array",
"items": { "type": "object",
"properties": { "sku": string, "qty": integer, "note": string },
"required": ["sku", "qty"] } }
Checked: your document validates against this schema.The 20-digit order ID is typed as an integer because the number is read exactly, not as a rounded double. Both order lines are combined into one items schema, so note is optional: it appears in the first line but not the second. The email and timestamp strings match their formats, so format annotations are added. Finally the payload is validated against the schema it produced and passes, which is the minimum a generated schema must do before you use it.
Paste a JSON document and get a JSON Schema for it instantly, in draft 2020-12 or draft-07, with types, required properties, nested objects, arrays and detected formats such as email and date-time. The tool then validates your document against the new schema and shows the result.
A JSON Schema describes the shape of JSON data: which properties exist, what type each one has, which are required and what format strings follow. Schemas are used to validate API requests and responses, describe OpenAPI endpoints, check configuration files, power editor autocompletion in VS Code and generate forms and types. Writing one by hand for a large document is slow and error-prone, so this generator writes a first version from an example document, which you then refine.
What it infers. Every value becomes a type: string, integer, number, boolean, null, object or array. Whole numbers become integer, and a property that is sometimes an integer and sometimes a decimal becomes number. Objects get properties, a required list and additionalProperties. Arrays get an items schema built from every element rather than only the first, so if one order line has a note and another does not, note is listed as optional. Properties that are sometimes null get a type that allows null. With format detection on, strings that are all valid emails, URIs, UUIDs, IP addresses, dates, times or date-times get the matching format; dates are checked against the calendar, so 2024-02-30 is not called a date.
Honest about what one example can prove. A single document cannot tell you everything about future data, so the defaults make only claims the document supports: a property is required only if it appears in every sample of its object. Options let you go further when you know more. You can refuse unknown properties (additionalProperties: false), turn small sets of repeated strings into an enum, add minimum and maximum, minLength and maxLength taken from the sample, include example values or placeholder descriptions. The notes explain the consequences, for example that bounds describe this sample rather than all valid data.
Checked before you use it. After generating the schema, the tool validates your original document against it with its own checker and tells you whether it passes. If an option makes the schema reject its own source, such as marking every property required when some only appear sometimes, the failing paths are listed. Numbers are read without converting them to floating point, so a 20-digit ID is described correctly as an integer and any example values are written exactly as they appear.
Drafts and privacy. Choose draft 2020-12, the current version used by OpenAPI 3.1, or draft-07, which older validators and tools still expect. Copy the schema or download it as schema.json. Everything runs in your browser, so production payloads and configuration files are never uploaded.
Generate a schema from a real response and use it as the starting point for an OpenAPI component or API documentation.
Create a schema from a sample payload and plug it into a validator such as Ajv to reject malformed input in your service.
Write a schema for a JSON configuration format and reference it so VS Code offers completion and warnings while editing.
Feed the schema to tools that generate TypeScript types, database models or form UIs.
Order lines {"sku": "A-1", "qty": 2, "note": "gift wrap"} and {"sku": "B-7", "qty": 1} produce an items schema with sku and qty required and note optional, because note appears in only one of the two lines.
A customer with "email": "ada@example.com" and "since": "2024-01-15T10:30:00Z" gets "format": "email" and "format": "date-time", since every sample of each property matches.
With "Refuse properties the document did not show" on, every object gets "additionalProperties": false, so a payload that adds an unexpected field fails validation.
Use draft 2020-12 for new work, OpenAPI 3.1 and up-to-date validators such as recent versions of Ajv. Choose draft-07 if your validator, framework or editor only supports older drafts, which is still common.
By default a property is required only if it appears in every sample of that object, for example in every element of an array. You can also mark every property required, which can make the schema reject its own source, or mark none.
Treat it as a strong first draft. One example cannot show every valid value, so review the types, required list and formats, and loosen or tighten them to match your real rules. The self-check confirms only that the example itself passes.
Not by default. In both drafts, format is an annotation unless the validator is configured to assert formats, as Ajv does with the ajv-formats package. It documents intent and helps tools, but many validators do not enforce it.
The document is read without converting numbers to floating point, so a 20-digit identifier is typed as integer and, if you include examples or bounds, written with every digit intact.
No. Parsing, inference and validation all happen in your browser.
Your text is processed locally in the browser. Nothing you paste or open is transmitted or logged.