Skip to main content
>_devtools

JSON Schema to Zod

Convert a JSON Schema into a Zod 4 or Zod 3 validator, with named $defs, recursion via z.lazy, and inferred types.

What this does

Paste a JSON Schema to generate Zod validators and optional inferred TypeScript types. Choose Zod 3 or 4 and set the generated root name.

Example

Schema:
{"type":"object","properties":{"email":{"type":"string","format":"email"}}}

Zod:
export const Root = z.object({
  email: z.email().optional(),
});

Limits and behavior

  • Some JSON Schema keywords have no direct Zod equivalent and are reported as warnings.
  • Only local references resolve; input is limited to 1 MiB.