Install & Import in Zod

From the Zod cheat sheet · Installation & Setup · verified Jul 2026

Install & Import

Install Zod and import it into your project

typescript
# Install Zod
npm install zod
bun add zod
pnpm add zod

// import.ts
import * as z from "zod";

const schema = z.string();
schema.parse("hello"); // "hello"
💡 Enable "strict": true in tsconfig.json for full type inference benefits
⚡ Zod has zero dependencies and works in Node, Bun, Deno, and the browser
📌 Use import * as z for the recommended namespace import pattern
🟢 One schema gives you both runtime validation AND a TypeScript type
installsetup
Back to the full Zod cheat sheet