DevTk.AI

JSON Schema Builder

Build JSON schemas visually for LLM structured outputs, function calling, and API validation.

Properties

No properties yet. Click "Add Property" to start building your schema.

Schema Preview

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object"
}

How to Use This Tool

  1. Click 'Add Property' to start building your schema. Each property needs a name, type, and description.
  2. Choose the property type: string, number, integer, boolean, array, or object. For arrays, you can specify the item type.
  3. Mark properties as 'Required' if they must always be present in the output. LLMs perform better with clear required/optional distinctions.
  4. Toggle 'LLM Structured Output Mode' to apply best practices for AI-compatible schemas (adds descriptions to all fields, uses enums for constrained values).
  5. Use 'Import from JSON Example' to automatically infer a schema from a sample JSON object — then refine it with the visual editor.
  6. Copy the generated JSON Schema from the preview panel and use it in your LLM API calls for structured outputs.

JSON Schema for LLM Structured Outputs

JSON Schema is a vocabulary that allows you to describe the structure of JSON data. In the context of AI development, JSON Schema is used to tell language models exactly what format their response should take. This is called 'structured output' — instead of getting free-form text, you get reliably formatted JSON that your application can parse programmatically.

All major AI providers now support structured outputs via JSON Schema: OpenAI's 'response_format' with 'json_schema' type, Anthropic's tool use with 'input_schema', Google's 'responseSchema' in Gemini, and function calling across all providers. The schema you build here works with any of these APIs.

Building effective schemas for LLMs requires some specific best practices: Always include descriptions for every property (they act as instructions for the model). Use enums to constrain string values when possible. Keep nesting shallow (2-3 levels max). Mark all essential fields as required. Avoid complex patterns like oneOf, anyOf, or deeply nested optional objects that can confuse models.

Common use cases for structured outputs include: extracting structured data from unstructured text (names, dates, addresses), generating consistent API responses, building conversational AI with typed actions, creating data pipelines that transform documents into database records, and implementing AI agents with typed tool calls.

Last updated: February 2026

FAQ

What is JSON Schema used for in AI?

JSON Schema defines the expected structure of LLM outputs. OpenAI's structured outputs, Anthropic's tool use, and most function-calling APIs use JSON Schema to tell the model exactly what format to respond in.

What is 'LLM Structured Output Mode'?

This mode applies best practices for LLM schemas: it adds descriptions to all fields (helps the model understand what to generate), uses enums for constrained values, and avoids patterns that confuse models like deeply nested optional fields.

Can I import from a JSON example?

Yes! Paste a JSON example and the tool will infer the schema automatically. It detects types, required fields, and array item types. You can then refine the generated schema using the visual editor.

Which AI providers support JSON Schema structured outputs?

All major providers support structured outputs in 2026: OpenAI (response_format with json_schema), Anthropic (tool use with input_schema), Google Gemini (responseSchema), Mistral (function calling), and Cohere (structured outputs). The JSON Schema format is universal across providers.

How do I use this schema with OpenAI's API?

Pass the generated schema as the 'json_schema' property in your API request's 'response_format' parameter. Set 'type' to 'json_schema' and include the schema under 'schema'. OpenAI will guarantee the response matches your schema structure, including required fields and types.

What's the difference between function calling and structured outputs?

Function calling lets models decide when and which function to call (used in agents and tool use). Structured outputs force every response into a specific JSON format (used for data extraction and formatting). Both use JSON Schema to define the expected structure, and the schema you build here works for both use cases.

Related Tools