Overview
Zod is a TypeScript-first validation library that defines schemas for runtime data while inferring static types from the same declarations. It is useful at boundaries such as API responses, form data, configuration, and other external input.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Parse runtime data into validated typed values
Schemas such as z.object describe expected structure, and .parse validates input before returning a strongly typed result.
Use async validation, transforms, and JSON Schema conversion
Async refinements use parseAsync, and schemas can also participate in transforms and JSON Schema workflows.
For explicit runtime boundaries around TypeScript applications
It fits API, form, environment, and configuration boundaries where untrusted values need runtime checks in addition to compile-time types.
Sources: [2]
Consider runtime cost and compilation restrictions
Large or hot-path validation should be benchmarked. The optional AOT compile path uses new Function, which may not be allowed under restrictive Content Security Policies.
Sources: [2]
Official sources
- [1]colinhacks/zod repository(2026-09-21)
- [2]Zod README(2026-09-21)
- [3]Zod documentation(2026-09-21)
- [4]zod package(2026-09-21)
- [5]Zod MIT license(2026-09-21)
Supplemental curator note
Zod validates runtime data that TypeScript types alone cannot protect, such as API inputs and environment variables. The current `zod` package is 4.6.5. The README also documents AOT compilation, which uses `new Function`; environments with restrictive CSP policies should verify whether that optimization is permitted.
Try it in 3 steps
- 1
Install Zod
Add Zod using the installation command from the official README.
npm install zod - 2
Define an object schema
Describe the expected runtime data shape in TypeScript.
const Player = z.object({ username: z.string(), xp: z.number() }) - 3
Validate input with parse
Parse an input and inspect the validated, typed result.
Player.parse({ username: "billie", xp: 100 })
Growth
Growth trends · Last 30 days
43,982 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 166
- Open PRs
- 19
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- typescript
- schema-validation
- type-inference
- runtime-validation
- static-types
- Stars
- 43,982
- Forks
- 2,198
- Watchers
- 84
- Open issues
- 47
- Contributors
- 463
- Primary language
- TypeScript
- License
- MIT
- Repository last updated
- Sep 19, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- T3 Env4,005 Stars
3 shared tag(s) · 2 shared category(s) · Same language
A TypeScript library that validates environment variables against schemas and brings runtime validation, type inference, and explicit server/client boundaries into application configuration.
TypeScript - React Hook Form44,868 Stars
2 shared tag(s) · 2 shared category(s) · Same language
A React forms library that manages input state, validation, errors, and submission through hooks while preserving native form behavior and reducing rerenders.
TypeScript - AutoForm3,494 Stars
2 shared tag(s) · 2 shared category(s) · Same language
A React form library that generates forms from existing schemas such as Zod and integrates with React Hook Form, TanStack Form, and multiple UI libraries.
TypeScript - Cal.diy48,583 Stars
2 shared tag(s) · Same language
A MIT-licensed self-hosted community scheduling platform with Cal.com's enterprise code removed.
TypeScript - Amical1,536 Stars
2 shared tag(s) · Same language
A local-first Electron dictation app using Whisper and local models for offline speech-to-text and text processing.
TypeScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.