AI Tools

AI JSON Schema Builder

Paste an example of the JSON you want back. Get a schema that OpenAI, Claude, or Gemini accepts for structured output, then check a model's reply against it.

Build and check schemas locally

Runs locally in your browser. Plain code, no AI model. Your JSON is not uploaded, saved, or shared.
0 characters

Builds as you type. A whole AI reply or almost-JSON works too. Give arrays several items to show which fields are optional.

Your schema will appear here.

Paste sample JSON to build its schema.

Ready when you are.

Watch: build and check a schema

No sound. Each step is captioned on screen and also written out in the guide below.

A working schema in three steps

  1. 01
    Paste an example

    Use JSON shaped like the answer you want. In arrays, a field missing from some items becomes optional.

  2. 02
    Pick your provider

    The schema follows that provider's documented rules, and anything it would reject is flagged.

  3. 03
    Check real replies

    Switch to Validate and paste what the model returned to see every field that doesn't fit.

Optional fields, per provider

[{"id": 1, "note": "gift"}, {"id": 2}]
OpenAI:  "note": {"type": ["string", "null"]}, required: ["id", "note"]
Claude:  "note": {"type": "string"}, required: ["id"]

OpenAI strict mode needs every field listed as required, so optional fields accept null instead. Claude and Gemini leave them out of required.

Frequently asked questions

What rules does each provider have?

As of 30 September 2026, from each provider's documentation:

  • OpenAI strict mode needs an object at the top level, "additionalProperties": false on every object, and every property in required. It allows up to 5,000 properties and 10 levels of nesting, and doesn't support allOf, not, or if/then/else. (OpenAI docs)
  • Claude needs "additionalProperties": false, and doesn't support recursion, number or length bounds, or minItems above 1. One request may have at most 24 optional fields and 16 fields with several types. (Claude docs)
  • Gemini documents a smaller set of keywords and only the date-time, date, and time formats. (Gemini docs)
Why are my optional fields required for OpenAI?

OpenAI strict mode requires every property to be listed in required. To keep a field optional, its type also allows null, and the model sends null when it has no value.

Does it guess limits like enums or string lengths?

No. One sample can't show the real limits, and several providers reject those keywords. Add enums and descriptions by hand where they matter; descriptions help the model most.

What does Validate check?

Types, required and extra properties, enums, formats, number and length bounds, patterns, arrays, anyOf/oneOf/allOf, and local $refs. Anything it doesn't check is listed, so a pass never hides a skipped rule.

Is my data sent anywhere?

No. Samples are often real customer data, so everything runs in your browser and nothing is uploaded, saved, or put in share links.