Zod
The default choice. 1st of 10 validation libraries.
Zod is the TypeScript-first schema library that most new TypeScript projects reach for. You get validation and a static type from one schema, with no dependencies. Zod 4 and the opt-in compiler added in 4.5 have closed most of its old speed gap. It is the default pick today, but watch two things: its default eval use can trip strict CSP setups, and a September 2026 credential compromise put a malicious commit in the repository (it was reverted and never reached npm).
Best for: Any TypeScript team that wants one schema to give both runtime validation and static types, with the widest ecosystem of integrations.
Scores
Overall9.0
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 9.0, likely 8.0 to 9.5
Zod is the default validation library for TypeScript today. It has the best ecosystem, strong quality, fast-moving maintenance and performance that is now competitive. Valibot is the better pick when bundle size matters and ArkType when raw speed does, but neither beats Zod for most people. The September 2026 credential compromise, the weak Scorecard and the CSP friction keep the range from reaching 10.
- peers: Leads every peer in stars and in direct-choice growth
- 2025.stateofjs.com/en-US/other-tools: Most used library in the survey
- dev.to/ashraf_chowdury09/zod-got-backdoored-your-lockfile-didnt-save-you-luck-did-e4l: Supply-chain incident discussion
GPT-6.2 Sol: 9.0, likely 8.1 to 9.6
Zod 4.6.7 is the best general-purpose choice in this group for a new TypeScript project because typed parsing, usable errors, and common integrations work together. Prefer Valibot when client bundle size dominates, or Ajv when JSON Schema is the source of truth. Workload-dependent performance and concentrated release ownership are the main reasons for the lower end of the range.
- zod.dev/basics: Shows the core typed parsing and error API.
- trpc.io/docs/server/validators: An established integration makes Zod its default recommendation.
- thoughtworks.com/content/dam/thoughtworks/documents/radar/2025/11/tr_technology_radar_vol_33_en.pdf: Identifies Valibot’s modular bundle-size advantage.
- zod.dev/json-schema: JSON Schema import remains experimental.
- deepkit.io/benchmarks: Relative throughput changes between valid input and detailed errors.
- intel.aikido.dev/packages/npm/zod: One listed npm maintainer.
Needed by many8.3
How many developers need a tool for this job?
Claude Opus 5.5: 8.5, likely 7.5 to 9.0
Almost every TypeScript app checks outside data: API input, forms, environment variables and LLM output. Zod's TypeScript-first approach fits that majority. Plain-JavaScript or JSON Schema-centric projects need it less, so this is not a 10.
- 2025.stateofjs.com/en-US/other-tools: Zod is the most-used library in the State of JS 2025 libraries chart
- dependents: 122,785 repos and 6,111 packages depend on it
GPT-6.2 Sol: 8.1, likely 7.0 to 9.0
Runtime validation applies to forms, API payloads, configuration, and other inputs across browsers and servers. Zod works with plain JavaScript, and schema inference is most valuable to TypeScript teams. The surveys show broad use, with some uncertainty about how often teams need a dedicated validator.
- zod.dev: Supports Node.js, modern browsers, TypeScript, and JavaScript.
- trpc.io/docs/server/validators: Documents Zod for API inputs and outputs.
- github.com/react-hook-form/resolvers: Shows inferred form types and validation.
- tsh.io/state-of-frontend: Measures use of validation libraries among surveyed frontend developers.
Helps a lot8.7
How well does it do the job for those who need it?
Claude Opus 5.5: 8.5, likely 7.5 to 9.0
Its type inference, API coverage, documentation and error handling are strong, and AI coding agents write correct Zod code very reliably. Zod 4 and the compiler lifted it close to Typia and ArkType in benchmarks. CSP friction from eval and a bigger bundle than Valibot keep it short of a 9+.
- infoq.com/news/2026/10/zod-schema-compliation: z.compile() is 3-9x faster, with lower memory use; it relies on new Function
- zod.dev/compile: Compiled Zod leads Moltar parseSafe; Typia and ArkType lead assertLoose
- bsky.app/profile/natemoo.re/post/3mjhn47lj722x: A user reports Zod v4 triggers unsafe-eval CSP violations by default
- npm hasTypes: Ships its own types
GPT-6.2 Sol: 8.9, likely 8.0 to 9.6
Zod pairs composable schemas and accurate type inference with field-level errors, transforms, and JSON Schema export. Versioned examples and searchable docs give coding agents a clear reference, though their accuracy was not measured directly. In Deepkit’s benchmark, ArkType and TypeBox processed valid data faster, while Zod returned detailed errors faster on the tested invalid input. Optional compilation helps eligible schemas, and its payoff depends on the schema and runtime.
- github.com/colinhacks/zod/releases/tag/v4.6.7: Confirms the stable version evaluated.
- zod.dev/basics: Shows typed parsing and structured error results.
- zod.dev: Provides agent-searchable docs and a plain-text reference.
- zod.dev/json-schema: Documents native export and experimental import.
- deepkit.io/benchmarks: Separately measures valid input and detailed errors on Zod 4.6.7.
- zod.dev/compile: Documents compilation, fallback behavior, and schema limits.
Holds up over time8.3
Will it still be a good choice in two years?
Claude Opus 5.5: 8.5, likely 7.5 to 9.0
The project is very active: 576 commits and 27 releases in the year, with issues handled quickly (108 open against 3,197 closed). The ecosystem keeps moving towards it. Two things hold the score down: it depends on one lead maintainer, and big rewrites like v3 to v4 cost users migration work.
- github commitsLastYear: 576 commits; pushed a day before readAt
- github releasesLastYear: 27 releases, latest v4.6.7
- github openIssues: 108 open against 3,197 closed
- infoq.com/news/2026/10/zod-schema-compliation: 4.6 fixed a 4.5 regression in recursive schemas
GPT-6.2 Sol: 8.1, likely 6.9 to 9.2
Zod shipped 27 releases and recorded 576 commits in the past year, and a small recent sample shows quick issue replies and pull request merges. Clerk funded Zod 4 development, and one account is listed as the npm maintainer. The v3-to-v4 upgrade changed validation behavior and caused downstream migration work. Continued funding and who could take over releases remain uncertain.
- github: 27 releases, 576 commits, and a push the day before collection.
- tracker.git.tools/colinhacks/zod: Shows quick sampled responses and a concentration of changes in one author.
- clerk.com/blog/zod-fellowship: Confirms funding for Zod 4 development.
- intel.aikido.dev/packages/npm/zod: Reports one listed npm publishing account.
- zod.dev/v4/changelog: Documents changes to record schemas and errors.
- github.com/NVIDIA/NeMo-Fabric/issues/485: Shows downstream migration constraints for dependencies still on Zod 3.
Used widely9.0
How many use it, and is that growing?
Claude Opus 5.5: 9.5, likely 9.0 to 10.0
Downloads grew from 217M to 1.83B per 4 weeks, a ratio of about 8.4 against a median of 4.1. Part of that comes from AI and MCP SDKs that install Zod for their users. Even so, State of JS puts it first by usage, and it is a direct choice in a huge number of projects.
- npm downloadsLast4Weeks: 1.83B, up from 217M a year earlier
- github stars: 44k stars, far ahead of every peer
- 2025.stateofjs.com/en-US/other-tools: Ranked 1st and up 2 places; 'a lot of growth year-over-year'
GPT-6.2 Sol: 8.4, likely 7.2 to 9.4
Four-week downloads grew 8.4× year over year against a 4.1× catalog median, and State of JavaScript also reported growth. Valibot grew faster from a smaller base, and ArkType drew more Bluesky links. ecosyste.ms found about 123,000 dependent repositories and 6,100 packages, with higher repository counts for Joi, Ajv, and the old TypeBox package. Repeated builds, transitive installs, and partial repository coverage leave the number of direct choices uncertain.
- npm downloadsLast4Weeks: 1.83 billion installs over four weeks.
- npm downloadsSame4WeeksYearAgo: 217 million installs in the comparable window.
- medianDownloadsRatio: 4.1× year-over-year baseline.
- dependents: 122,785 repositories and 6,111 packages in the index.
- github stars: 44,375 stars, the highest in the peer bundle.
- peers: Valibot grew 14.9×, and Ajv and old TypeBox have substantial transitive use.
- bluesky posts: 32 links to Zod, compared with 88 for ArkType and 12 for Valibot.
- 2025.stateofjs.com/en-US/other-tools: 5,241 respondents reported use, and the survey noted year-over-year growth.
Vouched for8.9
Who stands behind it being good?
Claude Opus 5.5: 9.0, likely 8.0 to 9.5
Major frameworks and SDKs build on it, including tRPC, React Hook Form and AI/MCP SDKs, and it leads current developer surveys. Outlets such as InfoQ cover its releases independently. Most benchmark numbers are still framed by Zod itself.
- 2025.stateofjs.com/en-US/other-tools: Top usage in State of JS 2025
- infoq.com/news/2026/10/zod-schema-compliation: Independent coverage; first-class support in tRPC and React Hook Form
- hackerNews top: Zod 4 launch story drew 782 points
GPT-6.2 Sol: 8.8, likely 7.8 to 9.5
tRPC recommends Zod by default, and Vercel AI SDK and React Hook Form maintain direct integrations. Clerk reports using Zod and funded the v4 work. The 2024 State of Frontend survey found 34.6% of respondents had used and liked Zod and 7.3% had used and disliked it. That sentiment survey predates v4, so current confidence rests more on maintained integrations and recent testing.
- trpc.io/docs/server/validators: Recommends Zod as the default validator.
- ai-sdk.dev/docs/reference/ai-sdk-core/zod-schema: Accepts Zod schemas directly for structured data and tools.
- github.com/react-hook-form/resolvers: Maintains a Zod resolver with v4 examples.
- clerk.com/blog/zod-fellowship: Reports using Zod to build Clerk and sponsoring v4.
- tsh.io/state-of-frontend: Reports direct user sentiment for Zod and its peers.
Safe6.7
How safe is it to depend on?
Claude Opus 5.5: 6.5, likely 5.0 to 7.5
It has no dependencies and an MIT licence, and only two advisories, both denial-of-service. One is a HIGH memory-exhaustion issue from October 2026. In September 2026 a stolen push credential put a malicious commit on main. It was reverted before publishing, and the publish process then moved to 2FA-gated staged releases. Scorecard is 5.5 with Code-Review 0 and Token-Permissions 0, so open concerns remain.
- advisories: 2 total; HIGH GHSA-mrhx-c7xc-m3w5 in 2026-10
- scorecard: 5.5 overall; Code-Review 0, Token-Permissions 0, Branch-Protection 3
- azeemhassni.com/blog/wire-zod-git-history-malware-commit-reverted: Malicious commit reverted before publishing; publishing then moved to 2FA-gated staged releases
- levelup.gitconnected.com/zod-4-6-6-on-npm-is-clean-but-the-malicious-commit-was-real-what-i-verified-and-4-settings-to-5bc560e8492f: An independent check found the 4.6.6 tarball clean
- npm dependencies: 0 dependencies
GPT-6.2 Sol: 6.9, likely 5.6 to 8.1
Zod has no runtime dependencies and uses the permissive MIT license. Version 4.6.6 shipped 10 days after the October advisory and fixed checks on bounded collections, while unbounded parsing can still accumulate errors and the v3 line remains affected. Malicious commits were reverted the day they reached the repository, never shipped to npm, and releases now use staged approval with provenance. A single listed npm maintainer and the 5.5 OpenSSF Scorecard, with weak review, token permissions, fuzzing, and branch protection checks, keep the score down.
- npm: Zero runtime dependencies and MIT license.
- scorecard: 5.5 overall, three relevant zero scores, and branch protection at 3.
- github.com/advisories/GHSA-mrhx-c7xc-m3w5: Lists 4.6.6 as the first patched version.
- github.com/advisories/GHSA-m95q-7qp3-xv42: The earlier email validation denial of service was patched in 3.22.3.
- zod.dev/basics: Documents error accumulation and a boolean validation path that stops early.
- github.com/colinhacks/zod/releases/tag/v4.6.6: Discloses the repository compromise and same-day revert.
- github.com/colinhacks/zod/pull/6638: Documents trusted publishing and the npm two-factor approval gate.
- inlinr.com/packages/zod/security: Reports provenance on 4.6.7 and one listed npm maintainer.
Good
- One schema gives runtime validation and an inferred static type, and the API covers codecs, recursion, JSON Schema output and many locales.
- It has the largest ecosystem in the category: tRPC, React Hook Form, the MCP and AI SDKs, many backend frameworks, and Standard Schema support.
- It has no dependencies, an MIT licence, and very active development: 576 commits and 27 releases in the last year.
- Zod 4 plus the opt-in z.compile() makes validation fast enough for most hot paths.
Bad
- By default Zod 4 uses new Function or eval, which strict Content Security Policies block unless you configure jitless mode.
- Its method-chaining design makes bundles larger than Valibot's, which matters for client-side code.
- Release and security depend heavily on one lead maintainer, and the OpenSSF Scorecard shows no enforced code review.
- Moving from v3 to v4 needed migration work, and some 4.x releases brought regressions, such as the 4.5 memory leak in recursive schemas.
The numbers
- npm downloads, 4 weeks
- 1.8B ×8.4 in a year
- GitHub stars
- 44k
- Commits, 12 months
- 576
- npm version
- 4.6.7 Oct 2026
- Versions, 12 months
- 27
- Advisories, 24 months
- 1 of 2 ever
- OpenSSF Scorecard
- 5.5 out of 10, Nov 2026
- Licence
- MIT
Read on 21 November 2026 from GitHub (colinhacks/zod), npm (zod), OSV and the OpenSSF Scorecard.