Generator

Zod Schema from JSON

Generate a Zod runtime validation schema from a sample JSON object. Auto-detects emails, URLs, and ISO datetimes.

Zod schema
import { z } from "zod";

export const UserSchema = z.object({
  id: z.number().int(),
  email: z.string().email(),
  name: z.string(),
  active: z.boolean(),
  createdAt: z.string().datetime()
});

export type User = z.infer<typeof UserSchema>;