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 | 12.5M | 274.7M |
| GitHub Stars | 23.7k | 43.8k |
| Bundle Size | 270.4 KB | 5.8 MB |
| Dependencies | 4 | 0 |
| Last Updated | 11 months ago | 6 days ago |
| TypeScript | Yes | Yes |
| License | MIT | MIT |
| Version | 1.7.1 | 4.5.4 |