JSON Schema Generator
Paste any JSON and get a valid JSON Schema instantly. Choose Draft 7 or 2020-12, detect formats, and merge array schemas automatically. Runs entirely in your browser.
{
// Generated JSON Schema will appear here...
}How it works
Three steps from raw JSON to a typed schema.
Paste example JSON
Copy a real API response, a scraped page payload, or any JSON you already work with. The more representative the sample, the more accurate the generated schema.
Set your options
Choose your schema version, toggle format detection, and decide whether all fields should be marked required. Then click Generate Schema.
Copy or download
Copy the output to your clipboard or save it as a .json file. Paste it into the Spidra API schema parameter, an OpenAPI spec, or any JSON Schema validator.
What is JSON Schema?
JSON Schema is a standard vocabulary for describing the structure of JSON data. You define which fields a document should contain, what type each field holds, which fields are required, and what constraints the values must meet. Any tool or service that understands JSON Schema can then validate data against that description automatically.
It is used across the whole stack: OpenAPI specifications, ORM definitions, AI structured output from OpenAI and Anthropic, form validation libraries, and extraction APIs like Spidra. Write it once and it works as a contract in multiple places.
Why use it with AI scraping?
AI scrapers return loosely structured output unless you give them a contract. When you pass a JSON Schema to Spidra, it becomes the exact output specification. The AI knows which fields to extract, what type each one should be, and which are required. Every page comes back in the same shape, ready to store or pass downstream without any cleaning.
Generate your schema here, copy it, and paste it into the schema parameter in your Spidra API call. That is all it takes to go from a free-form webpage to typed, structured data at scale.
Why use this generator?
Accurate inference, smart merging, zero server calls.
Recursive type inference
Handles deeply nested objects, arrays of objects, mixed-type arrays, and null values. Integers and floating-point numbers are distinguished correctly at every level of nesting.
Smart array merging
When an array contains multiple objects, the tool merges all item schemas into one. Fields present in every object become required. Fields that appear only sometimes are kept as optional.
Draft 7 and 2020-12
Choose between Draft 7, which is compatible with OpenAI, Anthropic, and OpenAPI 3.0, and Draft 2020-12, the current standard used by OpenAPI 3.1 and modern validators.
Entirely client-side
Your data never leaves your browser. Schema generation runs locally in JavaScript with no server round trips and nothing stored anywhere.
Frequently asked questions
Everything you need to know about JSON Schema generation.
