JSON Schema Builder
RUNS LOCALLYBuild a JSON Schema through a form rather than by hand, and watch the output update as you type. Export it as a plain schema, an OpenAI function-call definition or an Anthropic tool definition. You can also paste a sample response and have the properties inferred from it.
Your tool input is processed locally in your browser and is not intentionally uploaded to our servers. Advertising and analytics providers may still process normal page, device, cookie and network information.
How to use it
- Add a property, give it a name and type, and mark whether the model must always return it.
- Write a description for each property. Models follow descriptions closely, so this is the highest-value field.
- Open Advanced options to set additionalProperties, name the tool, or infer properties from a sample response.
- Choose an export format and copy or download the result.
A worked example
The example builds a four-property schema for sentiment analysis: a sentiment constrained to three enum values, a score bounded between 0 and 1, a summary string carrying a length instruction in its description, and an optional array of topics.
It shows the two constraints that do most of the work in practice. The enum stops a model inventing a fourth sentiment category, and the numeric bounds turn an out-of-range score into a validation error rather than a silently wrong value downstream.
Press Example in the workspace above to load it.
Questions
Should I set additionalProperties to false?
For structured output, usually yes. Without it, a model can add properties you never declared and the response still validates. Those extra fields then flow into your code unnoticed. Setting it to false turns an invented property into a validation error you can see. The main reason to leave it true is when you deliberately accept a pass-through payload.
What is the difference between the OpenAI and Anthropic export formats?
They wrap the same schema differently. OpenAI expects a function object with name, description and a parameters schema. Anthropic expects a name, description and input_schema. Neither carries the $schema keyword, so it is stripped on export. The schema body itself is identical, so you can switch formats without rebuilding anything.
Why are all inferred properties marked required?
Because a sample shows what was present in one response, not what is optional across all of them. Marking everything required is the honest starting point, and it is easier to untick the fields you know are optional than to notice a missing one later. Adjust the checkboxes after inferring.
How deeply can I nest objects?
Nesting is capped at five levels. Beyond that, schemas become hard for both people and models to follow, and deeply nested structured output is markedly less reliable. If you need more depth, it is usually a sign the task should be split into two calls.
Does my input leave the browser?
No. Your tool input is processed locally in your browser and is not intentionally uploaded to our servers. Advertising and analytics providers may still process normal page, device, cookie and network information. Nothing you paste is logged, stored or sent to an analytics event, and there is no account to attach it to.