Zod v4 targets performance, API design, and tooling support. Benchmarks show 14x faster string parsing, 7x faster array parsing, and 6.5x faster object parsing versus Zod 3. TypeScript type instantiation is reduced to accelerate compilation in large projects. A new @zod/mini distribution (~1.9 KB gzipped) enables tree-shakable validation for modern frontends by using wrapper functions instead of methods, shrinking bundles about sixfold. Format helpers moved to top-level functions to improve tree-shaking. Error handling is unified under a single parameter. Schemas can include strongly typed metadata, and built-in .toJSONSchema() provides JSON Schema conversion.
Zod v4 introduces a series of changes across three key areas: performance, API design, and tooling support. Benchmarks published by the maintainers show 14x faster string parsing, 7x faster array parsing, and 6.5x faster object parsing compared to Zod 3. These improvements are paired with reductions in TypeScript type instantiation, helping projects compile faster in large codebases. Another headline feature in this release is the introduction of @zod/mini, a lightweight distribution weighing just ~1.9 KB gzipped, designed for tree-shakable validation in modern frontend applications.
To enable this, Zod Mini generally uses wrapper functions instead of methods, so in regular Zod, a developer might use: import * as z from "zod"; z.string().optional(); Whereas in Zod Mini, the same functionality is achieved using a wrapper function: import * as z from "zod/mini"; z.optional(z.string()); The mini library is around 6x smaller than the standard Zod v4 package.
API refinements also feature prominently in Zod v4. Format helpers such as z.email(), z.uuid(), and z.url() have been promoted to top-level functions, replacing method calls and improving tree-shaking. Error handling has been unified under a single error parameter, replacing the previous fragmented approach (message, required_error, invalid_type_error). Developers can also now attach strongly typed metadata to schemas, enabling new workflows such as schema-driven form generation. Zod v4 further introduces built-in JSON Schema conversion via .toJSONSchema(), eliminating the need
Collection
[
|
...
]