Skip to main content

Package Manager Installation

Install Zod using your preferred package manager:

Requirements

Zod requires TypeScript 4.5+ for the best experience. You can use Zod with plain JavaScript, but you’ll miss out on static type inference.
  • TypeScript: 4.5 or higher (recommended)
  • Node.js: Works with all modern versions
  • Browsers: Works in all modern browsers

Runtime-Specific Setup

Node.js

Zod works out of the box with Node.js. Just import it in your code:

Deno

You can import Zod directly from npm in Deno:
Deno has built-in TypeScript support, so you get full type inference without additional configuration.

Bun

Bun has native support for npm packages:
Then import as usual:

Verify Installation

Create a simple test file to verify Zod is installed correctly:
test.ts
Run the file:
You should see:

Next Steps

Quick Start Tutorial

Learn the fundamentals with a hands-on tutorial