Command Palette

Search for a command to run...

position in category
#1

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:

  • Static type inference from schemas: define once, get both runtime validation and compile-time types
  • Zero dependencies, small bundle, runs in Node.js and browsers
  • Built-in JSON Schema conversion for OpenAPI docs and tooling
  • Composable and chainable API with transforms, refinements, and optional coercion
  • Ecosystem integrations: tRPC, form libraries, Prisma generators, OpenAPI codegen
  • Converts to and from JSON Schema, OpenAPI, Prisma, and Convex

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.

GitHub Repositories
1.6K
-8.4%
Trending down this week
Removed in 148 repos