IQ
PayloadIQ
PayloadIQ Utilities

JSON to JSON Schema

Paste a JSON sample and get a JSON Schema (Draft 2020-12) back — inferred types, nested schemas, typed array items, required fields and additionalProperties. It all runs in your browser.

JSON Schema appears here.

Runs in your browser. Your input is not uploaded to PayloadIQ.

JSON to JSON Schema turns a sample into a Draft 2020-12 schema you can validate against. It infers a type for every value (integer vs number, boolean, string), gives nested objects their own schema, types array items, lists every present key under required, and sets additionalProperties: false for a strict contract. Everything runs locally in your browser, so a real payload never leaves your machine.

Strict by default, easy to relax

The generated schema is intentionally strict — required fields and no extra properties — because it's easier to loosen a schema than to discover it was too permissive in production. Drop fields from required or flip additionalProperties as your API actually behaves. Rename the schema with the Title field.

For validation and OpenAPI

The output works with validators like Ajv and adapts into an OpenAPI components/schemas entry. Prefer a runtime validator with TypeScript types instead? Generate a Zod schema from the same payload, or open it in the PayloadIQ playground.

FAQ

Is my JSON uploaded?
No. The JSON is parsed and converted entirely in your browser with JavaScript — it never leaves your device. That makes it safe for real API responses, auth payloads, and anything internal.
Which JSON Schema draft is produced?
Draft 2020-12 (the $schema is set accordingly). The output validates objects with typed properties, nested object schemas, typed array items, a required list and additionalProperties: false — a strict, ready-to-use schema you can loosen as needed.
How are types and required fields inferred?
From the sample: whole numbers become integer and decimals number; true/false boolean; strings string; objects get their own nested schema; arrays become type array with an items schema inferred from the elements. Every key present in the sample is listed as required.
Can I use this for OpenAPI or validation?
Yes. The output is a standard JSON Schema you can drop into Ajv or a similar validator, or adapt into an OpenAPI components/schemas entry. Inference is sample-driven, so review formats (email, date-time, etc.) and relax required or additionalProperties where your API allows it.

Related utilities

JSON to ZodJSON to TypeScriptJSON Formatter / ValidatorJSON to SQLJSON VisualizerJSON MinifierJSON DiffJSON to CSV
Open PayloadIQ Playground