My take
Why I use Zod
Zod erases the gap between runtime values and compile-time types. I use it on every trust boundary - HTTP inputs, environment variables, LLM tool calls - to keep bad data from leaking into the type system.
Want the broader stack philosophy? Read about how Sri picks tools or browse engineering insights.
Honest assessment
Strengths & tradeoffs
No tool is perfect. Here's what shines and what to watch for.
Strengths
- Schema and type live in the same definition
- Composable, refinable schemas
- Excellent error messages
- Integrates with React Hook Form, tRPC, OpenAI structured outputs
- Runtime guarantees that match static types
Tradeoffs (honestly)
- Bundle size larger than Valibot or ArkType
- Heavy schemas can hurt cold-start in serverless
- Some advanced TS features push compile times
Fit assessment
When to reach for Zod
Pick the right tool for the job.
Best fits
Validating API request bodies
Form validation with React Hook Form
Parsing env vars on boot
Structured outputs from LLMs
Trust boundaries between subsystems
Not ideal for
Hot paths where validation cost matters (consider Valibot)
Languages other than TypeScript
Common use cases
Resources
Learn more
Curated official docs, tutorials, and writing on Zod.
Stack
Pairs well with Zod
Tools and platforms I commonly combine with this one.
Frameworks
More in this category
Frameworks that shape how I build apps and APIs.
Need help with Zod?
Whether you're starting fresh or optimizing an existing implementation, I can help you get the most out of this technology. Read more in insights or get in touch.