Skip to content
I Hate Online Tools

JSON schema builder

Define fields in a list and get a JSON Schema for structured model output.

Runs in this tab. The file stays here.

This runs in your browser. Nothing is uploaded.

About JSON schema builder

Add fields in a list and get a JSON Schema for structured model output or function calling, in plain form or wrapped for OpenAI strict mode.

Structured output and tool calls both want a JSON Schema, and it's tedious to type by hand. Add a field, name it, pick a type (string, number, integer, boolean, array, or object), add a description, and tick Required. String fields can have a list of allowed values separated by commas, which become an enum, and array fields take an item type. The schema on the right updates as you type. Descriptions matter more than they look, because the model reads them when deciding what to put in each field.

A switch picks the output. Plain JSON Schema is a draft 2020-12 schema with additionalProperties set to false. OpenAI structured output wraps the same schema in the response format object with strict mode on, and a name made from your schema title. Strict mode requires every property to be required, so in that mode all fields are listed as required whatever the checkboxes say, and the page tells you so.

It's for flat schemas. An object field is written as an empty object with no properties of its own, and there's no way to nest fields inside it, or to build anyOf, conditions, or references here. Hand-write those, and use the output as a starting point. Providers each accept a different subset of JSON Schema, so if one rejects the result, the cause is usually an unsupported keyword. Check their limits.

How to use JSON schema builder

  1. 1Set a schema title.
  2. 2Add a field for each value: name, type, description, and whether it's required.
  3. 3For strings, add allowed values; for arrays, pick the item type.
  4. 4Choose plain JSON Schema or OpenAI structured output, and copy the result.

What it won't do

  • Flat schemas: no nested object properties, anyOf, or $ref.
  • OpenAI mode forces every field to required.
  • Generates a schema only; it doesn't validate data.

Common questions

Why does my provider reject the schema?

Providers support different subsets of JSON Schema. Usual causes are keywords they don't accept, or a strict mode that wants every property required and additionalProperties set to false. Try the OpenAI wrapper if you're on OpenAI, and read your provider's limits otherwise.

Can I nest objects?

Not in the builder. An object field comes out empty. Copy the schema and write the nested properties by hand, or flatten the structure.

Why are all my fields required in OpenAI mode?

Strict structured output demands that every property is listed as required. If a value might be missing, give the model a way to say so, such as an allowed value of "unknown", instead of making the field optional.

Does it validate data against the schema?

No. It generates a schema. For checking a JSON document against a schema, use a validator in your own code.

Related tools

Why this one doesn't upload your file

There is no server to upload to. This page is a static file, and the work happens in your browser using the same graphics and WebAssembly code that renders every other site you visit. Your file is read from disk into memory, processed, and handed back as a download. Once the page has loaded you can disconnect from the network entirely and it keeps working. The longer explanation

Install the app