Search for a command to run...
TypeScript-first schema validation library that lets you define schemas for validating data at runtime while inferring static types. Schemas serve as the single source of truth: parse untrusted input and get type-safe output without duplicating type definitions.
Widely adopted across the TypeScript ecosystem and used by tRPC, React Hook Form, Conform, Superforms, and many API frameworks. Unlike Yup or Joi, Zod infers TypeScript types directly from schemas, so validation and typing stay in sync. Zero external dependencies, roughly 2kb gzipped, and an immutable, composable API.
Key capabilities:
Developers use Zod to validate API request and response payloads, enforce env vars and config shapes, parse JSON from external sources, and power form validation in React, Svelte, and Remix. Pairs well with tRPC and type-safe RPC stacks for end-to-end validated APIs.