yup vs zod
NPM Package Comparison - Which one should you use?
zod
ðMost PopularâMost StarredðŠķLightweightðRecently UpdatedðTypeScript
TypeScript-first schema declaration and validation library with static type inference
View Repository ânpm install zodDownload Trends (Last 12 Weeks)
When to Choose Each
ðChoose yup if:
- âBundle size is critical for your project
ðChoose zod if:
- âYou want the most battle-tested solution with a larger community
- âYou prefer fewer dependencies to reduce supply chain risk
- âYou need actively maintained software with recent updates
- âCommunity popularity and ecosystem support matter to you
Comparison
| Metric | yup | zod |
|---|---|---|
| Weekly Downloads | 11.8M | 179.8M |
| GitHub Stars | 23.7k | 42.8k |
| Bundle Size | 270.4 KB | 4.6 MB |
| Dependencies | 4 | 0 |
| Last Updated | 8 months ago | 2 weeks ago |
| TypeScript | Yes | Yes |
| License | MIT | MIT |
| Version | 1.7.1 | 4.4.3 |