Generates a Zod schema from a simple TypeScript interface.
TypeScript to Zod converts a single TypeScript interface or type-object into a matching Zod validation schema right in your browser. Paste an interface like `interface User { id: number; name: string }` and get back ready-to-use `z.object()` code with a `import { z } from "zod"` line and an exported schema. It is handy when you want runtime validation that mirrors your existing TypeScript types without writing the Zod schema by hand.
No. The conversion runs entirely in your browser using JavaScript, and nothing you paste is uploaded or stored anywhere. The whole site is client-side and open source so you can verify it.
A single `interface Name { ... }` or `type Name = { ... }` (optionally prefixed with `export`). It handles string, number, boolean, null, any/unknown, arrays (`T[]` and `Array<T>`), inline nested objects, unions, optional members with `?`, and string-literal unions which become `z.enum`.
Types it does not recognize (such as custom interfaces, Date, or generics) are mapped to `z.unknown()`. Replace those with the correct schema after generating, since the tool does not resolve references to other types.
No. The tool parses exactly one interface or type-object per run. Convert each type separately and combine the resulting schemas in your code.
Parsing requires a complete interface or type-object declaration; bare object bodies, enums, function types, or multiple declarations are not accepted. Each member must be in `field: type` form, or the tool throws an error.