Zod
Backend & InfraTypeScript-first schema validation with static type inference
Release History
v4.3.51 featureThis release introduces improvements to mini treeshaking and documents the deprecation of the 'message' symbol.
v4.3.4Breaking1 fix3 featuresThis release introduces patternProperties support for looseRecord and improves documentation, while removing the .refine() method from ZodMiniType and dropping ISO time in fromJSONSchema.
v4.3.3Version 4.3.3 release containing a single commit update.
v4.3.2Breaking1 fixVersion 4.3.2 is a maintenance release that removes the Juno integration and refines strictObject validation within intersections.
v4.3.11 featureThis release introduces support for non-overwriting extends when using refinements, improving how configurations or schemas are merged.
v4.3.0Breaking2 fixes12 featuresZod 4.x introduces major features including JSON Schema to Zod conversion, exclusive unions (xor), exact optional properties, and improved intersection logic for strict objects.
v4.2.1Version 4.2.1 is a maintenance release containing a single commit.
v4.2.05 featuresThis release introduces native JSON Schema interoperability with z.fromJSONSchema() and .toJSONSchema(), alongside new schema types like z.xor() and z.looseRecord().
v4.1.138 fixes6 featuresZod v4.1.13 introduces MAC address validation, z.meta/z.describe, and significant performance optimizations for initialization. It also addresses several edge-case bugs in records, tuples, and localization.
v4.1.124 fixes2 featuresVersion 4.1.12 focuses on bug fixes for ZodError flattening, internal error type refactoring, and significant updates to the ecosystem documentation.
v4.1.11Version 4.1.11 is a maintenance release identified by commit 2bed4b3.
v4.1.101 fixVersion 4.1.10 is a patch release that addresses a bug in shape caching.
v4.1.91 fixThis release updates the zshy dependency and publishes zod version 4.1.9.
v4.1.81 fixVersion 4.1.8 is a maintenance release that switches an internal implementation back to using WeakMap.
v4.1.76 fixes5 featuresRelease 4.1.7 focuses on expanding locale support (Lithuanian, Georgian), fixing CIDRv6 validation logic, and ensuring array defaults are shallow-cloned. It also includes significant documentation improvements and ecosystem updates.
v4.1.51 featureVersion 4.1.5 updates the z.function() type signature to allow array inputs and includes documentation updates.
v4.1.41 fixVersion 4.1.4 is a patch release focusing on fixing OpenAPI 3.0 schema generation for null values in tuples and updating installation documentation.
v4.1.3Breaking5 fixesVersion 4.1.3 focuses on fixing JSON Schema generation bugs for OpenAPI 3.0 and Draft-7, while also removing the stringToBoolean utility.
v4.1.21 fix2 featuresRelease 4.1.2 focuses on fixing OpenAPI 3.0 schema generation for record tuples and improving codec documentation.
v4.1.13 featuresVersion 4.1.1 introduces new methods and image support, alongside documentation improvements and a sidebar cleanup for codecs.
v4.1.0Breaking1 fix6 featuresZod 4.1 introduces Codecs for bi-directional data transformation and .safeExtend() for type-safe object extensions that preserve refinements. It also adds a new z.hash() validator and strongly-typed decode/encode methods.
v4.0.171 fix1 featureVersion 4.0.17 introduces a new blog feature and includes a fix for issue #5073.
v4.0.163 fixes2 featuresVersion 4.0.16 introduces a new discriminator generic and includes several bug fixes related to keyof enum returns, POJO cloning during defaulting, and documentation site navigation.
v4.0.152 fixesVersion 4.0.15 addresses recursive initialization errors in the check() method and refines TypeScript type definitions by removing redundant Required wrappers.
v4.0.142 fixes2 featuresVersion 4.0.14 introduces JSON Schema draft-04 support, improves tuple recursive inference, and resolves an infinite loop bug in defineLazy.
v4.0.131 fixVersion 4.0.13 addresses a bug related to the interaction between optional types and pipe operator syntax.
v4.0.124 featuresVersion 4.0.12 focuses on documentation improvements, including the addition of LLM-readable text files and new guides for JWT and property validation.
v4.0.112 fixes1 featureThis release introduces the Yoruba (yo) locale, updates the Zod dependency to version 4.0.11, and includes minor documentation fixes.
v4.0.103 fixes4 featuresRelease v4.0.10 focuses on documentation improvements for v3 and v4, including the addition of the Zod Playground and various minor bug fixes.
v4.0.9Version 4.0.9 is a maintenance release containing a single commit (PR #4970).
v4.0.81 fixThis release includes a bug fix for issue #4961.
v4.0.71 fixVersion 4.0.7 fixes a bug in ZodPipe where parsing would continue even after validation issues were identified.
v4.0.6Breaking4 fixes5 featuresZod v4.0.6 introduces new Icelandic, Bulgarian, and Danish translations, fixes literal escaping bugs, and refines the catch input type. It also updates documentation for RFC 9562 and provides resources for Zod 3 to Zod 4 migration.
v4.0.51 fix1 featureVersion 4.0.5 introduces support for pipe syntax within discriminated unions, resolving issue #4856.
v4.0.41 fixThis release introduces a ZodFirstPartyTypeKind stub to resolve module resolution errors encountered when using zod-to-json-schema.
v4.0.3Breaking3 fixes1 featureThis release removes the global File interface and fixes JSR provenance issues across versions 4.0.2 and 4.0.3.
v4.0.13 featuresZod 4.0.0 is officially released on npm, promoting the stable v4 subpaths to the primary package exports with no code changes from the latest 3.25.x release.
v3.25.761 fixVersion 3.25.76 is a maintenance release focusing on internal cleanup of the $ZodRegistry and documentation corrections for error formatting.
v3.25.751 fixThis release addresses a bug in the toJSONSchema function specifically regarding the handling of undefined types.
v3.25.741 featureVersion 3.25.74 introduces support for partial records.
v3.25.73Version 3.25.73 is a maintenance release containing a single commit (1021d3c).
v3.25.723 fixes1 featureVersion 3.25.72 introduces Esperanto locale support and includes bug fixes for schema optionality and symbol re-exports.
v3.25.71BreakingThis release updates the project structure by moving the source code into a dedicated /src directory.
v3.25.701 fix3 featuresVersion 3.25.70 focuses on documentation updates, including a new ecosystem listing on the homepage and the addition of svelte-jsonschema-form to integrations.
v3.25.692 fixes1 featureVersion 3.25.69 introduces an 'exact' field to size-related validation issues and includes internal improvements to the release workflow and default value handling.
v3.25.68Breaking3 fixes4 featuresRelease 3.25.68 introduces z.stringFormat(), removes the 'example' and 'examples' properties, and updates internal dependencies and documentation regarding treeshaking.
v3.25.671 fix1 featureVersion 3.25.67 introduces a generic $ZodLiteralDef for better type handling and resolves a race condition bug.
v3.25.66Breaking1 fix2 featuresThis release updates the default behavior of ZodObject to $strip and includes documentation improvements and minor bug fixes for the website.
v3.25.651 fix2 featuresVersion 3.25.65 introduces catchall support for zod-mini, removes deprecated chalk types, and includes minor documentation fixes for template literals.
v3.25.643 fixesThis maintenance release focuses on bug fixes for the $strip utility and mime pathing, while improving environment compatibility by safely checking for stack trace APIs.
v3.25.633 fixes2 featuresVersion 3.25.63 introduces improved ISO date parsing with support for hours-only offsets and updates the husky development dependency to v9.
v3.25.62Breaking1 fixRelease 3.25.62 focuses on refining JSON schema types by removing 'undefined' from their definitions.
v3.25.611 fix1 featureVersion 3.25.61 introduces looser signatures for index signature shapes and includes minor test fixes.
v3.25.60No release notes provided.
v3.25.592 fixes1 featureThis release focuses on internal code refactoring, formatting fixes, and enhancements to JSON Schema typing.
v3.25.583 fixes4 featuresThis release introduces Pashto locale support, improves Japanese translations, and enhances type safety for the .meta() function. It also expands the ecosystem documentation with Zod Sockets and SvelteKit Superforms.
v3.25.574 fixes2 featuresVersion 3.25.57 introduces support for ReadonlyArrays in z.literal and includes several bug fixes related to error instances and type checks.
v3.25.56This release consists of a single commit updating the version to 3.25.56.
v3.25.55Version 3.25.55 is a maintenance release containing a single commit.
v3.25.542 fixesThis maintenance release addresses a cross-realm object validation bug and resolves a TypeScript-related generic assignability issue.
v3.25.531 featureVersion 3.25.53 introduces internal updates to the zod mini implementation.
v3.25.521 fix1 featureVersion 3.25.52 includes a fix for JSON handling and introduces a new test case for deferred self-recursion.
v3.25.512 featuresVersion 3.25.51 focuses on internal standardization of string formats and improvements to documentation and generic type testing.
v3.25.501 fix1 featureThis release focuses on improving error reporting by flattening deep error structures and ensuring inclusive boundary reporting for length validation.
v3.25.49Breaking2 fixes2 featuresThis release updates z.custom to treat validation issues as fatal and includes several documentation fixes and minor feature enhancements for regex and enums.
v3.25.481 fixVersion 3.25.48 is a maintenance release that removes a debugging console statement from the ZodDiscriminatedUnion internal logic.
v3.25.471 fixVersion 3.25.47 is a maintenance release that addresses a bug related to excessively deep processing or recursion.
v3.25.462 fixes1 featureVersion 3.25.46 focuses on improving error clarity for discriminated unions and fixing a specific bug related to branded types in records.
v3.25.452 fixesVersion 3.25.45 focuses on bug fixes for JSONSchema enum generation and resolving ZodType assignability issues.
v3.25.441 fix1 featureVersion 3.25.44 focuses on improving type safety and stability by refining input/output depth handling and broadening metadata type definitions.
v3.25.432 fixes1 featureThis release focuses on fixing type inference within the ZodMiniType check method and improving declaration file stability, while also introducing the Express Zod API to the ecosystem.
v3.25.421 featureVersion 3.25.42 introduces improvements to Next.js tree shaking to optimize build performance and bundle size.
v3.25.411 fixVersion 3.25.41 is a maintenance release focusing on portability fixes and documentation updates regarding nullability.
v3.25.403 featuresThis release focuses on improving JSON Schema generation for File types and intersections, specifically targeting better compatibility with OpenAPI standards.
v3.25.391 featureVersion 3.25.39 introduces support for array-based function inputs.
v3.25.38Version 3.25.38 is a minor update that includes the addition of new tests.
v3.25.371 featureVersion 3.25.37 introduces improvements to type inference within the z.function implementation and adds a major version section to the documentation.
v3.25.361 featureVersion 3.25.36 introduces support for arbitrary strings in JWT algorithm specifications.
v3.25.35Breaking2 fixes1 featureVersion 3.25.35 improves discriminated union handling, fixes the isPlainObject utility, and removes default values from JSON Schemas for transforming schemas.
v3.25.343 fixes2 featuresRelease 3.25.34 focuses on refining type inference for preprocessing, optimizing transform execution, and fixing documentation typos.
v3.25.334 fixes6 featuresThis release introduces support for Khmer, Swedish, Dutch, and Traditional Chinese locales alongside several documentation improvements and minor bug fixes for schema shape validation.
v3.25.322 fixes1 featureThis release introduces support for multiple string patterns in JSON Schema generation and fixes issues related to default and prefault object handling.
v3.25.311 fix1 featureVersion 3.25.31 introduces support for custom messages in stringbool validation and includes internal improvements to the isObject utility.
v3.25.301 fix2 featuresVersion 3.25.30 introduces support for v4/mini paths, improves web URL documentation, and fixes typing for z.instanceof.
v3.25.29Breaking3 fixes2 featuresThis release introduces the unwrap method for ZodArray and standardizes URL behavior while fixing bugs related to string validation parameters and build warnings.
v3.25.283 fixes2 featuresVersion 3.25.28 focuses on improving ZodFunction typing, fixing package distribution exports, and correcting documentation typos.
v3.25.271 fix1 featureVersion 3.25.27 introduces the .value property to ZodLiteral and implements the override keyword for internal class consistency.
v3.25.261 fixThis release includes a fix for the .register methods and updates the documentation to replace z.min and z.max references.
v3.25.25Breaking1 featureThis release introduces stricter schema validation for output objects by defaulting 'additionalProperties' to false and includes new documentation for Zod Core parsing.
v3.25.244 fixes1 featureThis release focuses on improving environment compatibility, specifically for the Hermes engine and older bundlers, while resolving minor bugs and error naming issues.
v3.25.231 fixVersion 3.25.23 is a patch release that fixes incorrect JSON Schema identifiers.
v3.25.222 fixes2 featuresVersion 3.25.22 focuses on documentation corrections for safeParse and repository maintenance, including the removal of src and test directories from the published package.
v3.25.211 fix2 featuresThis release focuses on fixing input types for custom validators and introducing z.core, alongside improved documentation for error mapping.
v3.25.201 featureThis release introduces a global fallback for the File object to improve handling when specific implementations are unavailable.
v3.25.18Version 3.25.18 is a maintenance release with no specific features or fixes detailed in the commit log.
v3.25.172 fixes1 featureVersion 3.25.17 introduces a tshy-style build system and fixes issues related to locale wildcard resolution and type definition compatibility.
v3.25.161 fixThis release includes a bug fix for wildcard handling.
v3.25.15Version 3.25.15 release consisting of two maintenance commits.
v3.25.144 fixes1 featureVersion 3.25.14 focuses on CI/CD improvements, including the introduction of canary releases and fixes for build processes and ESM compatibility.
v3.25.13Version 3.25.13 is a maintenance release containing a single commit.