Refer to the Changelog for a complete list of breaking changes. Zod 4 is now in beta after over a year of active development. It's faster, slimmer, more tsc-efficient, and implements some long-requested features. To install the beta: Development will continue on the v4 branch over a 4-6 week beta period as I work with libraries to ensure day-one compatibility with the first stable release. ❤️Huge thanks to Clerk, who supported my work on Zod 4 through their extremely generous OSS Fellowship. They were an amazing partner throughout the (much longer than anticipated!) development process. Zod v3.0 was released in May 2021 (!). Back then Zod had 2700 stars on GitHub and 600k weekly downloads. Today it has 36.5k stars and 23M weekly downloads. After 24 minor versions, the Zod 3 codebase has hit a ceiling; the most commonly requested features and improvements require breaking changes. Zod 4 implements all of these in one fell swoop. It uses an entirely new internal architecture that solves some long-standing design limitations, lays the groundwork for some long-requested features, and closes 9 of Zod's 10 most upvoted open issues. With luck, it will serve as the new foundation for many more years to come. For a scannable breakdown of what's new, see the table of contents. Click on any item to jump to that section. You can run these benchmarks yourself in the Zod repo: $ git clone git@github.com:colinhacks/zod.git $ cd zod $ git switch v4 $ pnpm install Then to run a particular benchmark: $ pnpm bench string runtime: node v22.13.0 (arm64-darwin) benchmark time (avg) (min … max) p75 p99 p999 ------------------------------------------------- ----------------------------- • z.string().parse ------------------------------------------------- ----------------------------- zod3 348 µs/iter (299 µs … 743 µs) 362 µs 494 µs 634 µs zod4 132 µs/iter (108 µs … 348 µs) 162 µs 269 µs 322 µs summary for z.string().parse zod4 2.63x faster than zod3 $ pnpm bench array runtime: node v22.13....
First seen: 2025-04-12 21:55
Last seen: 2025-04-13 05:58