JSON → Zod & JSON Schema
Infer Zod schemas and JSON Schema from JSON.
Zod schema
Array elements are merged: objects with different keys produce unions, and keys missing from some elements become optional. Dates and other non-JSON types come out as string — add .datetime() or a refine where you need more.
About this tool
Paste JSON and get a ready-to-use Zod schema with optional keys and merged array unions — or spec-shaped JSON Schema. Generated locally, never uploaded.
It runs completely in your browser — no input is sent anywhere, and this page loads no ads or third-party scripts, so it is safe to use with data you would not paste into a hosted service.