Schema Inspector
Paste a JSON object or an array of records to infer a JSON Schema (or OpenAPI schema object) — with field types, required/optional, formats, and enum candidates. A field profile and Prisma model draft sit in the extended view. Runs in your browser.
Auto-infers as you type. Ctrl+Enter to re-run.
How to use the Schema Inspector
Paste a JSON payload and instantly see its typed schema — every property, its inferred type, optional vs required, nested arrays and objects, and formats. Use the Schema Inspector to understand undocumented API responses, draft a starter JSON Schema or OpenAPI component, model a database table (Prisma), or generate example data. Inference runs entirely in your browser.
What it does
- Builds a typed profile of any JSON document — every field's type(s), occurrence, and format.
- Infers JSON Schema (Draft-07 / 2019-09 / 2020-12) or an OpenAPI 3.0 / 3.1 schema object from one or more sample payloads.
- Detects optional vs required fields across array items.
- Reports arrays of mixed types, deeply nested shapes, and enum candidates (small distinct value sets).
- Suggests formats when fields look like emails, UUIDs, ISO dates, or URLs.
- Drafts a Prisma model from the inferred fields, and links to the JSON Schema Validator and Synthetic Data Generator.
When to use it
- Reverse-engineer the shape of an undocumented third-party API.
- Draft an OpenAPI component schema from an existing response.
- Draft a Prisma model, or feed the schema to a type generator (e.g., json-schema-to-typescript).
- Plan a database table or NoSQL document model from a real record.
- Onboard to a new service quickly by seeing the field profile at a glance.
- Write fixtures that match production payload structure.
How to use it
- Paste JSON into the editor (an object, or an array of records).
- The inferred schema renders automatically; the Fields & Prisma tab shows types, optionality, and warnings.
- Paste multiple representative payloads to improve required/optional accuracy across array items.
- Copy the inferred JSON Schema, refine it manually, then run it through the Schema Validator.
- Generate matching example data with the Synthetic Data Generator.
Tips & pitfalls
- If a field is always
nullin your sample, the inferred type isnull— provide a non-null example for accurate typing. - Arrays inferred from a single example may understate variability — paste multiple records when possible.
- Constraints (
minimum,maximum,minLength) are off by default — enable the Min/max option to include them. - Small distinct value sets (e.g.,
"open" | "closed") are suggested as enum candidates — switch Enums to "Emit enum" to include them. - For OpenAPI 3.0, choose that format — the tool emits
nullable: trueinstead oftype: [..., "null"].
FAQ
- How do I infer a JSON Schema from a sample? Paste the sample JSON; the Schema Inspector produces a Draft-07 / 2019-09 / 2020-12 schema you can copy and refine.
- How does it detect optional fields? When you paste an array of objects, fields present in some items but not all are marked optional (tune the Required strategy).
- Can I generate TypeScript types? The inferred schema can be fed to a generator (e.g., json-schema-to-typescript); the Inspector drafts a Prisma model directly.
- Does it detect enums and formats? Yes — small distinct value sets are suggested as enums; emails, UUIDs, URLs, and ISO date strings are suggested as
format. - Is my JSON uploaded? No — all inference happens in your browser.
- What is the difference between this and the Schema Validator? The Inspector infers a schema from data. The Validator checks data against an existing schema.
Runs locally in your browser. No uploads. No analytics on pasted JSON.
Related guides
Common tasks solved by this tool
- Inspect the structure, fields and types of JSON or schema data
- Validate example JSON against an OpenAPI schema
- Understand JSON Patch vs Merge Patch semantics
- Understand required fields and nesting in a payload
- Prepare a schema draft from a representative sample
Continue in a JSON/API workflow
Chain this into related tools, or build it as a saved workflow in Workflows.
- Format or inspect JSON
- Inspect JSON or schema structure — this tool
- Compare two JSON documents
- Validate against a schema
Part of the JSON and API contract toolkit
Validate schemas, compare JSON responses, generate JSON Patch operations and debug API contract examples with related privacy-first tools.