TYPESCRIPT → ZOD SCHEMA
Paste a TypeScript interface or type and instantly get a Zod schema. Handles primitives, optionals, unions, literals, arrays, nested objects, and more. No backend — runs entirely in your browser.
TYPESCRIPT INPUT
ZOD SCHEMA
// Zod schema will appear here
// e.g.
export const UserSchema = z.object({
id: z.number(),
email: z.string(),
name: z.string().optional(),
});
export type User = z.infer<typeof UserSchema>;SUPPORTED SYNTAX
Primitives
string, number, boolean, Date, null, undefined, any, unknown, never
Optional fields
field? → .optional() suffix on schema
Unions & literals
'a' | 'b' → z.enum([]) · T | null → .nullable()
Arrays & generics
T[], Array<T>, Record<K,V>, Partial<T>, Set<T>
Nested objects
Inline objects become nested z.object() schemas
Type aliases
type X = ... → const XSchema = ...
Named refs
Unknown types become NameSchema references
Multiple types
Paste several interfaces at once — all will be converted