JSON Schema Builder
Processed Client SideBuild a JSON Schema for LLM structured outputs and tool use, then export to OpenAI, Anthropic, Gemini, Zod, and Pydantic — all generated in your browser.
Bookmark this tool now — skip the search next time you need it.
About JSON Schema Builder
This tool runs entirely in your browser. Whatever you paste is processed on your own device and is never uploaded, logged, or sent to any server.
The JSON Schema Builder is a visual editor for the schemas that constrain an LLM’s output. Add fields, give each one a type and a description, nest objects and arrays as deep as you need, drag rows to reorder them — then export the same structure as plain JSON Schema, an OpenAI response_format block, an OpenAI function definition, an Anthropic tool input_schema, a Gemini schema, a Zod object, or a Pydantic model. Writing these by hand is tedious and easy to get subtly wrong, and every provider wraps the same schema in a slightly different envelope. Building it once and switching the export tab removes both problems.
Key features
- Visual field editor — name, type, description, and required flag per field, with no hand-written braces
- Seven field types: string, number, integer, boolean, enum, object, and array
- Unlimited nesting: objects hold child fields, and arrays get a single item definition describing their element shape
- Drag rows by the handle to reorder fields; key order carries through to every export
- Seven export targets: JSON Schema (draft 2020-12), OpenAI response_format, OpenAI function, Anthropic, Gemini, Zod, and Pydantic
- Provider envelopes generated correctly — strict mode, additionalProperties, and the required array are all filled in the way each API expects
- Descriptions carried into every format, because they are what actually steers the model’s field-by-field output
- Enum values typed as a simple comma-separated list and expanded into the right construct per target
- Live field count, and everything generated in your browser — no key, no account, no upload
How to use it
- Name the schema, then add your first field and pick its type.
- Write a description for each field — it is the instruction the model reads, so be specific.
- For an object, add child fields inside it. For an array, define the single item shape that every element follows.
- Mark which fields are required, and drag rows to put them in a sensible order.
- Switch to the export tab for your provider and copy the generated schema straight into your code.
Tips & common mistakes
- Descriptions do the heavy lifting. "ISO 8601 date, e.g. 2026-03-14" produces far more reliable output than a bare string field called date, whatever the model.
- OpenAI strict structured output requires every property to be listed in required and additionalProperties to be false. The OpenAI exports do that for you — which is why an optional field there has to be modelled as a nullable type rather than an absent one.
- Prefer enum over a free-text string whenever the value comes from a fixed set. It is the single most effective way to stop a model inventing a fourth status.
- Keep schemas shallow. Deeply nested structures are harder for a model to fill in consistently, and easier to debug when they are two levels rather than five.
- Zod and Pydantic exports are for validating the response after it arrives. Sending the JSON Schema and validating with the generated model is the pair that catches a bad response before it reaches your code.
- Field order is preserved through every export, and models tend to fill fields in the order they are given — put the fields that need the most reasoning after the ones that provide context for them.
- This builds the contract. To mock an example response that satisfies it, use the JSON Payload Generator, and to check a real response against it, use the JSON Schema Validator.
- To convert plain JSON to YAML or back, use the JSON ⇄ YAML Converter.