zod
- 4.6.7 is the latest, published 12 October 2026.
- 1 security advisory, all fixed.
- 4.x: 58 releases since 9 July 2025, 13 in the last 90 days.
Security advisories
Grouped by the version that fixes them, so one upgrade reads as one step.
Fixed in 3.22.3 · 1 advisory
- MODERATEZod denial of service vulnerabilityGHSA-m95q-7qp3-xv42
Releases in the last 90 days
Feed of releases and advisoriesEvery stable release, newest first. Notes are quoted as the maintainers published them.
4.6.7
12 October 20264.6.6
11 October 2026types: declare record output and input as members, not base type arguments
Six malicious commits pushed to
mainon September 21 with a compromised git credential were reverted the same day in #6620 and have since been removed from the history ofmain. None were ever published to npm. The npm provenance for 4.6.6 names 284243fb, the pre-rewrite copy of 9c219833 with identical contents.Commits
fix(types): declare record output and input as members, not base type arguments
fix(v4): check array, set and map size bounds before parsing elements
4.6.5
13 September 2026instanceof: key the .properties() shape off the instance type
Commits
feat(instanceof): key the .properties() shape off the instance type
Revert "feat: add z.currencyCode() over a vendored ISO 4217 list, refreshed weekly by CI (#6595)"
Revert "Revert "feat: add z.currencyCode() over a vendored ISO 4217 list, refreshed weekly by CI (#6595)""
4.6.4
13 September 2026A patch on top of 4.6.3.
A patch on top of 4.6.3.
feat: add
z.currencyCode()over a vendored ISO 4217 list, refreshed weekly by CIperf:
z.url()rejects an invalid URL withURL.canParse()instead of a throwing constructor, about 50x faster; fewer allocations on the validation path
4.6.3
12 September 20264.6.2
10 September 20264.6.1
9 September 20264.6.0
9 September 2026Zod 4.6 is now available.
Zod 4.6 is now available.
npm install zod@latest
At a glance:
.validate()— checks input validity without building a result (up to 35x faster than.safeParse().successon a compiled schema)z.instanceof().properties()— validates properties of an instancefromJSONSchema()— enforces six validation keywords it used to ignorez.iban()— electronic-format IBAN plus mod-97 checksumz.withParser()— installs a parser generated elsewhere, for environments withoutnew FunctionFaster CommonJS — drops the getter on every export (~3x faster
z.validate()underrequire)Memory retention in recursive schemas — releases the parsed input, fixing a 4.5 out-of-memory regression
@zod/mini— Zod Mini as a standalone package, versioned in lockstep withzodsince 4.5
.validate()Standalone boolean validation, in Zod, Zod Mini, and Zod Core. It answers "is this input valid?" without constructing a
ZodError, which makes rejection cheap. The return type is a guard on the schema's input type.z.validate(z.string(), "hi"); // true z.validate(z.string(), 42); // false
It is a method on Zod Classic schemas too.
const Player = z.object({ username: z.string(), xp: z.number(), }); if (Player.validate(data)) { data.username; // narrowed }In conjunction with
z.compile(), this can be up to 35x faster than.safeParse().successon invalid input.Time per call on invalid input, schemas compiled with z.compile(), safeParse().success as a gray bar with .validate() as a blue bar inside it: a union of 3 objects 28 ns (34.9x faster), an array of 10 strings 23 ns (24.6x), a 3-element tuple 28 ns (16.1x), a 5-key object 21 ns (16.3x), a discriminated union of 3 21 ns (15.7x), z.number() 19 ns (13.8x), z.string() 19 ns (13.2x), z.boolean() 19 ns (13.7x); up to 34.9x faster
Time per call on invalid input, compiled with z.compile() — lower is better (benchmark)
Uncompiled schemas
Without compilation it is up to 5.9x faster. The saving is the result object:
.safeParse()allocates one with an accessor pair on every call, and.validate()allocates nothing.Time per call on invalid input, plain schemas, safeParse().success as a gray bar with .validate() as a blue bar inside it: a union of 3 objects 659 ns (1.5x faster), an array of 10 strings 211 ns (2.3x), a 3-element tuple 166 ns (2.5x), a discriminated union of 3 93 ns (3.3x), a 5-key object 75 ns (3.9x), z.number() 47 ns (5.3x), z.string() 42 ns (5.8x), z.boolean() 42 ns (5.9x); up to 5.9x faster
Time per call on invalid input, plain schemas — lower is better (benchmark)
Both charts measure the failure path. The key feature of
.validate()is that it can short-circuit on the first issue it encounters, instead of aggregating a fullZodIssue[]array.[!NOTE] Async refinements are covered by
.validateAsync().z.properties()A new API for validating specific properties of an object. Unlike
z.object()it validates in-place, so it plays nice with class instances.const responseLike = z.properties({ status: z.number().min(200).max(299) }); responseLike.parse(new Response("ok", { status: 200 })); // ✅ a real Response responseLike.parse({ status: 204 }); // ✅ a plain objectA corresponding
.properties()method has been added toZodInstanceOf.Zod
4.5.4
29 August 2026v4: stop the cycle walk from firing a default factory
Commits
fix(v4): stop the cycle walk from firing a default factory
4.5.3
29 August 2026docs: drop the OG description when the title wraps past two lines
Commits
fix(docs): drop the OG description when the title wraps past two lines
bench(v4): z.compile() against zod-compiler
fix(v4): emit record numeric keys as strings in toJSONSchema
Show 3 earlier releases
4.5.2
29 August 2026docs: keep blog posts out of the docs collection
Commits
fix(docs): keep blog posts out of the docs collection
fix(v4): let a prototype method getter answer a bare call so vi.spyOn works
fix(docs): match the blog TOC hover bar to the 2px active indicator
fix(docs): drop ISR on the docs route so the home page hydrates
fix(docs): render blog tabs with the stock fumadocs tab card
4.5.0
28 August 2026Zod 4.5 is now available.
Zod 4.5 is now available.
npm install zod@latest
At a glance:
z.compile()— the flagship feature of Zod 4.5z.creditCard()— 12–19 digits plus Luhn checksumz.properties()— the multi-property counterpart toz.property()z.deepPartial()/.exactPartial()z.validate(): boolean— a fast-path to verify input validity without a full parse (up to 16x faster on invalid data)9x reduction in memory footprint
New locales: Bengali (
bn), Central Kurdish (ckb), Hindi (hi), Kannada (kn), Norwegian Nynorsk (nn), Brazilian Portuguese (pt-BR), Slovak (sk), Turkmen (tk)
z.compile()You can now pre-compile any Zod schema using
z.compile(schema). This dramatically speeds up parsing performance.import * as z from "zod"; const Player = z.object({ username: z.string(), bio: z.string(), xp: z.number(), // ...20 more properties... }); const CompiledPlayer = z.compile(Player);A compiled schema can be used exactly like an uncompiled one. There are no special rules around compiled schemas. They're just faster.
Player.parse({ ... }); CompiledPlayer.parse({ ... }); // ~9x fasterOn objects, arrays, and unions, this speeds up parsing by a factor of ~3–9. More complex schemas stand to benefit more than simpler ones.
Time per parse by schema type, standard parser vs compiled — lower is better (benchmark)
Below are the Moltar benchmark results comparing Zod (compiled and uncompiled) against the Moltar ParseSafe bench.
Throughput on the moltar benchmark fixture (parseSafe: returns a new object with unknown keys stripped) — higher is better (benchmark)
And the equivalent results for the Moltar AssertLoose bench. Tested against the new
z.validate(schema, input)function (detailed later in the post).Throughput on the moltar benchmark fixture (assertLoose: returns a boolean, unknown keys allowed) — higher is better (benchmark)
Zod's entire test suite runs twice—once normally and again with auto-compilation enabled globally—to ensure perfect fidelity.
How it works
Under the hood,
z.compile()walks the entire schema once and produces a hyperoptimized snippet of flat, loop-free JavaScript that can validate inputs far faster than a standard runtime validator. This snippet can be executed vianew Function()(effectively a more powerfuleval) to serve as a fast-path validator. Schemas use this to "fast check" validity, falling back to the regular runtime logic on validation failure to provide granular error information.Take this simple
Pointschema:const Point = z.object({ x: z.number(), y: z.number() });Here is the generated snippet for it:
const isPoint = new Function("input", ` if (typeof input !== "object" || input === null) return false; if (typeof input.x !== "number") return false; if (typeof input.y !== "number") return false; return true; `); isPoint({ x: 1, y: 2 }); // true isPoint({ x: "1" }); // falseFor the large majority of inputs, the generated function validates the data with the fastest logic JavaScript can express: straight-line
typeofchecks and property reads, with no interpreter in between. When it can't handle an input, Zod falls back to the standard parser.This is the function Zod generates for the
Playerschema above:4.5.1
28 August 2026Release notes
Major versions
- 4.xsince 9 July 2025 · latest 4.6.7 · 58 releases
- 3.xsince 17 May 2021 · latest 3.25.76 · 183 releases
- 1.xsince 7 March 2020 · latest 1.11.17 · 62 releases
Quality and security signals
What npm and deps.dev say about the latest release. Signals, not a verdict.
Reading npm and deps.dev…
Registry facts last checked 15 October 2026. Releases and advisories last read 15 October 2026.
Know when your own dependencies move
Inlinr tracks your coding time automatically. Switch dependency tracking on for a project and it reads that repository's manifest to show what is behind and what has been deprecated — off by default, one project at a time.