Infer a Schema from JSON
Paste any JSON payload — even a deeply nested API response — and get an inferred structural schema with property names, types, and optional fields.
Open Schema Inspector with a ready-to-run example.
- You receive a response from an undocumented or poorly documented third-party API and need to understand its structure.
- You want a head start on writing an OpenAPI component schema for an existing API.
- A colleague has sent you a large JSON blob and you need a quick overview without reading every field.
- You are generating TypeScript types or database columns from a JSON payload.
- Paste the JSON payload into the Schema Inspector input.
- The tool recursively analyses the structure and displays types for every property.
- Fields that appear in some array items but not others are marked as optional.
- Export the inferred JSON Schema and refine it with
requiredand validation constraints.
- Inference is based on the values present — if a field is always
nullin your sample, the inferred type will benull, not the actual data type. - Paste multiple representative responses to get more accurate optional/required detection for array items.
- The inferred schema has no validation constraints (min, max, enum) — you must add those manually.
- For deeply nested objects, use the tree view to navigate rather than scrolling through raw JSON Schema output.
Nested API response with array
{
"user": {
"id": 101,
"name": "Alice",
"email": "alice@example.com",
"roles": ["admin", "editor"],
"address": {
"city": "London",
"country": "GB"
}
},
"meta": {
"page": 1,
"total": 42
}
}
user:
id integer
name string
email string
roles array of string
address:
city string
country string
meta:
page integer
total integer
Schema inference analyses a JSON value and produces a structural description — property names, data types, nesting, and optional versus required fields based on what is present in the sample data.
Yes. For arrays of objects the inspector merges all element shapes and marks fields that appear in only some elements as optional in the resulting items schema.
Yes. Export the inferred JSON Schema and use it as a starting point for an OpenAPI component schema. Add descriptions, examples, and constraints before including it in your spec.
Privacy-first: runs locally in your browser. No uploads.