Zod

TypeScript-first schema declaration and runtime validation library with static type inference.

HN commenters use Zod for runtime validation of forms, API routes and API responses on both client and server,123 and as a schema source of truth shared across languages and API contracts.456 The main caveats are reports of suspicious code in the v4.6.6 release78 and complaints that its schema-first approach is harder to read and debug than defining types directly.910
The HN verdict, written from 10 cited comments
8recommend
4warn against
Nov 18, 2025first mention
Oct 12, 2026latest mention
Nov 25 – Oct 26
Used forfor TypeScript devsfor API validationfor full-stack appsfor cross-language schemasschema validationprotocol validation

Why people recommend it

Runtime validation · 3

Used to validate forms, API routes, API responses and wire protocols at runtime on client and server.

“I use it heavily for form validation on the client and the server”

“I use Zod for strict schema validation on all API routes”

Show 1 more

Shared schemas · 3

Serves as a single source of truth for data shapes across languages and contract-first APIs.

“I prefer to use Zod or JSON Schema as the source of truth.”

“the support for JSON Schema is much better across the stacks I use, e.g. Zod in JS/TS, Pydantic in Python”

Show 1 more

“use zod (or your language equivalent) and contract-first API development; this is my favourite bit tbh”

works on a reasonably large project with agentson “Harness engineering: Leveraging Codex in an agent-fi…”

Ecosystem fit · 3

Commenters pair it with Drizzle, Django Ninja with InertiaJS and Vue, and the postgres library.

“I use it heavily for form validation on the client and the server”

Show 1 more

API design · 1

Its API design is credited as influential enough for other libraries to replicate.

“the hard work that the original designers of libraries like FastAPI, Zod, Pydantic, have invested”

Bundle size · 1

One commenter reports no issues with its bundle size and would use it even without TypeScript.

“Even without TS, I'd be using zod (or a similar library). I haven't had any issues with zod's bundle size”

Caveats and dissent

Compromised release · 2

Commenters flagged a suspicious commit in v4.6.6 and said the compromised code was still tagged on GitHub.

“The compromised code is still tagged on Github”

Schema-first types · 2

Some dislike writing schemas and using derived types, and find it hard to read and debug.

“I don't like zod. I want to define my types, not write schemas.”

Runtime speed · 1

A build-time compiler project reports 2-74x faster parsing than standard Zod.

“The plugin swaps Zod with compiled parse.”

Limited expressiveness · 1

One commenter says their TypeScript schema typing goes far beyond what Zod can express.

“We're going far beyond what's capable with Zod or ArkType.”

Often compared with

Who recommends it in their own words

All comments 16

“The compromised code is still tagged on Github”

“We're going far beyond what's capable with Zod or ArkType.”

“I use it heavily for form validation on the client and the server”

“the support for JSON Schema is much better across the stacks I use, e.g. Zod in JS/TS, Pydantic in Python”

“The plugin swaps Zod with compiled parse.”

“Even without TS, I'd be using zod (or a similar library). I haven't had any issues with zod's bundle size”

“I don't like zod. I want to define my types, not write schemas.”

“use zod (or your language equivalent) and contract-first API development; this is my favourite bit tbh”

works on a reasonably large project with agentson “Harness engineering: Leveraging Codex in an agent-fi…”

“the hard work that the original designers of libraries like FastAPI, Zod, Pydantic, have invested”

“I use Zod for strict schema validation on all API routes”

“I prefer to use Zod or JSON Schema as the source of truth.”

Threads where it came up

Also written as zod. Data: zod.json. Quotes are verbatim; the verdict and theme labels are written by a model from these comments, and every clause links to its sources.

Keyboard shortcuts
j / kNext / previous item
o or EnterOpen selected item
/Search
g hHome
g tTop
g rRising
g cCategories
tToggle dark mode
?This help