To go from JSON to JSON Schema, paste one or more samples of your data into our free JSON Schema generator, choose what the schema is for (plain JSON Schema, OpenAI structured outputs, Claude, or an MCP tool) and press Make schema. You get a schema with types, nested objects, required fields and formats, a ready request part for the provider you picked, and a list of any rule the provider would reject. Then paste a model's answer into the validator to see exactly where it breaks the schema. It all runs in your browser.
What a JSON Schema does
A JSON Schema is a description of what valid JSON looks like: which fields exist, which are required, what type each one is, and which extra fields are allowed. AI providers use it to force a model's answer into a fixed shape, which is called structured outputs, and to describe the inputs of a tool the model can call. Writing one by hand for a real API record is slow and easy to get wrong, which is why most people start from a sample. The format itself is defined at json-schema.org.
Generate a JSON Schema, step by step
- Open the JSON Schema generator. Paste your data into Sample JSON (one value, or JSON Lines with one sample per line), or press Try an example.
- Pick a target in Made for:. The choices are Plain JSON Schema (draft 2020-12), OpenAI structured outputs (strict mode), Claude structured outputs and strict tools and MCP tool inputSchema. The Name box, set to "response" by default, names the schema or tool in the request part.
- Check the options. Make every field required, Do not allow extra fields (additionalProperties: false), Detect formats such as date-time, date, email, uuid and URLs, and A top-level list is a set of samples. The OpenAI and Claude targets switch on the options they need and lock them.
- Press Make schema, then Copy schema, Download schema.json, or Validate JSON with this schema, which copies it into the validator below.
A worked example: two samples in, one schema out
The more samples you give, the better the schema, because the generator learns which fields are always there. Here are two job records as JSON Lines, one per line. The second has no salary and an extra field, visa:
{"title": "Data Analyst", "company": "Acme", "remote": true, "salary": {"min": 70000, "max": 90000}, "posted": "2026-12-01"}
{"title": "Backend Engineer", "company": "Globex", "remote": false, "salary": null, "posted": "2026-11-28", "visa": false}
With Plain JSON Schema this is the output (spacing shortened here), labelled "from 2 samples, merged":
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"title": { "type": "string" },
"company": { "type": "string" },
"remote": { "type": "boolean" },
"salary": {
"type": ["object", "null"],
"properties": {
"min": { "type": "integer" },
"max": { "type": "integer" }
},
"required": ["min", "max"]
},
"posted": { "type": "string", "format": "date" },
"visa": { "type": "boolean" }
},
"required": ["title", "company", "remote", "salary", "posted"]
}
Four things happened that a single sample could not show:
- visa is optional. It appeared in only one of the two samples, so it is left out of required.
- salary can be null. One sample had an object and one had null, so the type is
["object", "null"]. - posted has a format. Both values were valid dates, so
"format": "date"was added. - Whole numbers are integers. 70000 and 90000 became
integer. If any sample had a decimal, the field would benumber.
JSON Schema for structured outputs: OpenAI, Claude and MCP
Run the same samples with OpenAI structured outputs (strict mode) and the schema changes in three ways. Every object gets "additionalProperties": false. Every field goes into required, and visa, which was optional, becomes "type": ["boolean", "null"], because strict mode wants optional fields to be required and allow null. The $schema line is left out. The tool also adds a warning: "format" works with standard OpenAI models but is rejected for fine-tuned models.
Each target checks the rules of its provider, and lists every break as a problem or a warning:
| Target | Main rules checked |
|---|---|
| OpenAI strict mode | Top level is an object and not anyOf; additionalProperties false on every object; every field in required; no allOf, not, if, then, else, dependentRequired or dependentSchemas; at most 10 levels of nested objects, 5,000 properties, 1,000 enum values and 120,000 characters of names and values |
| Claude | additionalProperties false on every object; no oneOf (use anyOf) or not; no recursive schemas; minimum, maximum, minLength, maxLength and multipleOf flagged as not supported; minItems above 1 may be rejected |
| MCP tool | inputSchema has "type": "object" at the top level; a warning if $schema names a version other than 2020-12 |
Formats are checked too. OpenAI's list in the tool is date-time, time, date, duration, email, hostname, ipv4, ipv6 and uuid; Claude's list also has uri. When you generate for one of them, only formats on its list are added. The provider rules were checked against OpenAI's structured outputs guide and Anthropic's structured outputs documentation on 5 December 2026, and the page shows that date next to the checks.
If your data's top level is a list or a single value, the OpenAI, Claude and MCP targets wrap it in a field called items or value, because they need an object at the top, and a note says so.
Under the schema you also get a request part to paste. For OpenAI it is a text.format block with "type": "json_schema" and "strict": true for the Responses API. For Claude it is an output_config.format block, plus the same schema as a strict tool with input_schema. For MCP it is a tool definition with inputSchema, as described in the MCP tools specification.
JSON Schema validator: check a model's answer
Models sometimes return JSON that almost fits. The validator, in section 2 of the same page, shows exactly where. Paste the schema into JSON Schema, the answer into JSON to check, and press Validate. If the answer is wrapped in a Markdown code fence, the fence is removed for you, and text before or after the JSON is ignored, as AI answers often have both.
Checked against the plain schema above, this answer:
{"title": "QA Lead", "company": "Initech", "remote": "yes", "salary": {"max": 95000}, "posted": "2026-13-01"}
gives Not valid. 3 problems found. with a list like this:
- /remote should be true or false, but it is text ("yes")
- /salary is missing the required field "min"
- /posted is not a valid date (example: 2026-12-05)
Each line starts with the path to the bad value, so you can fix the prompt or the code that reads it. Under Also check the schema for: you can run the provider rules on a schema you wrote yourself, and Which keywords are checked? lists every keyword and format the validator covers. Drafts 2020-12, 2019-09, 7, 6 and 4 are supported; unevaluatedProperties, unevaluatedItems and references to other files are reported as not checked rather than silently passed.
Private, and fast enough for real responses
API responses often hold customer names, prices or internal IDs. Here they stay on your device: the work runs in a background worker inside your browser, with a 10 second limit so a slow pattern in a schema cannot freeze the page. Each box takes up to 5 MB, and the validator lists up to 300 problems.
Where to go next
Once the schema works, an MCP server can use it as a tool's inputSchema. Our guide to the Claude Desktop config and the MCP config generator show how to connect that server to a client. If you also need the same JSON as a spreadsheet, JSON to Excel and JSON to CSV flatten it, and our guide to turning a JSON API response into Excel covers the details. Building an agent that needs live hiring and salary data? See our API and MCP page.
Frequently asked questions
How do I make a JSON Schema from JSON?
Paste a sample of your JSON into the generator and press Make schema. Types, nested objects, lists and required fields come from the sample. Paste several samples, one per line, so fields that are sometimes missing are marked optional.
What makes a schema work with OpenAI strict mode?
Every object needs additionalProperties set to false and every field must be listed in required. A field that is optional stays required and allows null instead. The OpenAI preset does this for you and flags keywords and formats OpenAI does not support.
Does it work for Claude tools and MCP servers?
Yes. The Claude preset gives a schema plus a request part for structured outputs or a strict tool. The MCP preset gives a tool definition with an inputSchema whose top level is an object.
Which JSON Schema versions does the validator support?
Draft 2020-12 by default, and drafts 2019-09, 7, 6 and 4 when the schema names them in $schema. A few keywords, such as unevaluatedProperties and references to other files, are reported as not checked.
Is my JSON uploaded?
No. The generator and the validator run inside your browser, so API responses and schemas never leave your device.
Spotted an error? Write to dealmahal.official@gmail.com.
Questions or corrections: dealmahal.official@gmail.com.