About the JSON Schema Generator
This tool builds a JSON Schema from a simple field list — name, type, description, and whether each field is required — and formats it four ways: as a standalone JSON Schema, as an OpenAI Structured Outputs response_format block, as an OpenAI function-calling tool definition, and as an Anthropic tool-use definition. Getting an LLM to reliably return structured JSON depends on matching each provider's exact expected shape, which differs more than most people expect — this tool handles those differences (including OpenAI's specific requirement around optional fields) so you don't have to hand-edit JSON to match each provider's quirks. Everything is generated locally in your browser.
Provider Differences
OpenAI wrappingStructured Outputs nests your schema under response_format.json_schema.schema. Function calling nests it under function.parameters, inside a {"type": "function", "function": {...}} wrapper.
Anthropic wrappingNo function wrapper — name, description, and input_schema sit directly at the top level of each tool object.
OpenAI's "all required" ruleIn strict mode, every property must be listed in required. To make a field effectively optional, its type becomes a nullable union, e.g. ["string", "null"], instead of being left out of required.
Anthropic's requiredUses standard JSON Schema semantics — a field left off required is genuinely optional, no nullable-type workaround needed.
additionalPropertiesSet to false in every generated schema here, which both providers' strict/structured modes expect — it blocks the model from inventing fields you didn't define.
Send Feedback
For any questions, bug reports, or feature requests, please drop your comments below.