>_
{S}

JSON Schema Generator

Generate a JSON Schema from sample JSON. Strict mode makes it valid for OpenAI structured outputs, and one click wraps it as an OpenAI response_format, OpenAI function or Anthropic tool definition.

Runs locally — your input never leaves this page.

Output

How to use

  1. Paste an example of the JSON you want the model to return, for example the object your app expects.
  2. Turn on Strict for LLM structured outputs: every field becomes required, fields missing from some samples become nullable, and additionalProperties is set to false.
  3. Pick an output format: a plain JSON Schema, an OpenAI response_format, an OpenAI function/tool, or an Anthropic tool with input_schema.
  4. Copy the result straight into your API call.

FAQ

Why does OpenAI reject my schema with “all fields must be required”?

With strict: true, OpenAI requires every property to appear in required and additionalProperties: false on every object. Optional values must be expressed as a union with null — exactly what Strict mode generates.

Does this work for Claude tool use?

Yes. Choose “Anthropic tool” to get { name, description, input_schema }, the shape the Messages API expects in its tools array.

How are numbers and arrays inferred?

Values become string, number, boolean or null. Arrays merge all their elements, so a key present in only some objects becomes optional (or nullable in Strict mode). Edit the result to add enum, description or integer where you need tighter constraints.

Report a bug or suggest a feature →