Developer tools · data validation library
Zod
Hacker Approved
Popular TypeScript schema library that validates untrusted data at boundaries and infers static types. Critics cite added dependency weight, inferred-type quirks, and the reported 4.6.6 malware compromise.
Summarized from 91 comments.
Popular TypeScript schema library that validates untrusted data at boundaries and infers static types. Critics cite added dependency weight, inferred-type quirks, and the reported 4.6.6 malware compromise.
- recommend
- 58
- criticize
- 20
- months recommended
- 11 of 13
Why people love it
Validates data at API boundaries · 7
undeniably the best part about zod. Yes, you could define all of your types this way, but it's only necessary at the boundary of the program
Jun 2026 · commentWhenever I write an API I'll use Zod and whatever middlewares my framework needs to generate json schema for consumers
May 2026 · commentit can be significantly improved upon by using a library to verify the structure of deserialized data
Nov 2025 · commentErgonomic and easy to use · 5
Zod is by far the most ergonomic way to express those ideas in TypeScript these days.
Jun 2026 · commentZod is more ergonomic, has easier apis and is perfect for most users
Jun 2026 · commentFound it pretty easy to use, and it's helped clean things up a good bit
Aug 2026 · commentGenerates static TypeScript types · 3
For runtime types I've leaned on Zod or Effect schema,which can also generate static types for you.
Jun 2026 · commentI'm a fan of using satisfies to check Zod definitions against the interfaces they validate.
Nov 2025 · commentwhich I'd say shines in representing typescript's type system in code
Jun 2026 · commentWorks well with TypeScript frontends · 3
I've got it well integrated with Zod for type safe JS/TS front-ends as well.
Mar 2026 · commentusing Hono + Zod has been brilliant for creating types that my frontend can consume
Feb 2026 · commentwe just use Zod's branded type and that pretty much handles it
May 2026 · comment
What people warn about
Adds runtime dependency and boilerplate · 5
zod can't be a dev only dependency, and you have to deal with breaking changes and maybe switching to a completely different library in a few years
Jun 2026 · commentnow you have added a massive runtime dependency instead of local validation
Jul 2026 · commenthow much code is spent simply producing an enormous amount of Zod schemas and unit tests around them
Sep 2026 · commentSecurity concern after 4.6.6 compromise · 5
They cut and submitted a compromised release to npm; npm just happened to block the publishing.
Oct 2026 · commentIt definitely doesn't inspire confidence in the project taking security seriously.
Oct 2026 · commentThe malware seems to inject some JS payload to execute when zod is installed
Oct 2026 · commentInferred types hurt IntelliSense · 2
then have to deal with the inferred types which among other things tend to suck for IntelliSense etc.
Jun 2026 · commentit's a lot easier to work with types you've declared in TypeScript than the ones Zod generates
Nov 2025 · commentPoor fit for some use cases · 3
Zod was really not designed for the use-cases I want JSON schemas for
Nov 2025 · commentZod is quite unpleasant to use, IME, an has some edge cases where you lose code comments.
Nov 2025 · commentinstead of zod, you should use the @standard-schema/spec package
Nov 2025 · comment
What hackers pick instead
- PydanticPython library that validates data against type-annotated models, popular with FastAPI and AI output. Critics call it slow, heavy and prone to breaking changes.62recommend
- clojure.specBuilt into Clojure, spec lets people express structural guarantees more expressively than an ordinary type system. Critics say it mostly retrofits static typing onto a dynamic language.18recommend
- MalliA Clojure library for runtime data validation and schema-based example generation; commenters prefer it to ordinary type systems for rigidity.15recommend
- Guardrails AIDevelopers recommend it for forcing AI agents to pass tests and build checks, and for being simpler with less code. It is free software.5recommend
Every quote
The 40 most detailed of 91 comments. Each links to the original.
undeniably the best part about zod. Yes, you could define all of your types this way, but it's only necessary at the boundary of the program
Recommends · Jun 2026 · in “Parse, Don't Validate – In a Language That Doesn't Want You To”
Whenever I write an API I'll use Zod and whatever middlewares my framework needs to generate json schema for consumers
Recommends · May 2026 · in “Introduction to Atom”
it can be significantly improved upon by using a library to verify the structure of deserialized data
Recommends · Nov 2025 · in “Rust in Android: move fast and fix things”
For runtime types I've leaned on Zod or Effect schema,which can also generate static types for you.
Recommends · Jun 2026 · in “Elixir v1.20 released: now a gradually typed language”
it's a lot easier to work with types you've declared in TypeScript than the ones Zod generates
Mixed · Nov 2025 · in “`satisfies` is my favorite TypeScript keyword (2024)”
I'm a fan of using satisfies to check Zod definitions against the interfaces they validate.
Recommends · Nov 2025 · in “`satisfies` is my favorite TypeScript keyword (2024)”
Zod is by far the most ergonomic way to express those ideas in TypeScript these days.
Recommends · Jun 2026 · in “Parse, Don't Validate – In a Language That Doesn't Want You To”
using Hono + Zod has been brilliant for creating types that my frontend can consume
Recommends · Feb 2026 · in “Ship Types, Not Docs”
Zod is fantastic for this use-case, and I'm sad I've only just discovered it.
Recommends · Dec 2025 · in “The Rise of SQL:the second programming language everyone needs to know”
I've got it well integrated with Zod for type safe JS/TS front-ends as well.
Recommends · Mar 2026 · in “Java Is Fast. Your Code Might Not Be”
Found it pretty easy to use, and it's helped clean things up a good bit
Recommends · Aug 2026 · in “Zod v4.5 adds schema compilation (3-9x faster validation)”
which I'd say shines in representing typescript's type system in code
Recommends · Jun 2026
Zod is more ergonomic, has easier apis and is perfect for most users
Recommends · Jun 2026 · in “Parse, Don't Validate – In a Language That Doesn't Want You To”
I use it heavily for form validation on the client and the server
Recommends · Aug 2026 · in “Zod v4.5 adds schema compilation (3-9x faster validation)”
If you just slap in Zod, the server will drop the extra inputs.
Recommends · Dec 2025 · in “GraphQL: The enterprise honeymoon is over”
In JS, libraries like Zod and Valibot are a dream to work with.
Recommends · Nov 2025 · in “How I fell in love with Erlang”
we just use Zod's branded type and that pretty much handles it
Recommends · May 2026 · in “A Couple Million Lines of Haskell: Production Engineering at Mercury”
I use Zod for strict schema validation on all API routes
Recommends · Jan 2026 · in “Show HN: I built an OSHA compliance SaaS for oilfields using only LLMs”
the value of letting the schema do a lot of the guarding
Recommends · Jul 2026 · in “TypeScript 7”
zod can't be a dev only dependency, and you have to deal with breaking changes and maybe switching to a completely different library in a few years
Criticizes · Jun 2026 · in “Parse, Don't Validate – In a Language That Doesn't Want You To”
then have to deal with the inferred types which among other things tend to suck for IntelliSense etc.
Criticizes · Jun 2026 · in “Parse, Don't Validate – In a Language That Doesn't Want You To”
how much code is spent simply producing an enormous amount of Zod schemas and unit tests around them
Criticizes · Sep 2026 · in “Should TypeScript support runtime types instead of relying on Zod?”
They cut and submitted a compromised release to npm; npm just happened to block the publishing.
Criticizes · Oct 2026 · in “Zod 4.6.6 compromised by malware?”
Zod is quite unpleasant to use, IME, an has some edge cases where you lose code comments.
Criticizes · Nov 2025 · in “`satisfies` is my favorite TypeScript keyword (2024)”
I also hate writing intermediate schemas (zod, valibot, etc.) to get runtime type safety
Criticizes · Oct 2026 · in “C# now beats Rust on WASM size”
It definitely doesn't inspire confidence in the project taking security seriously.
Criticizes · Oct 2026 · in “Zod 4.6.6 compromised by malware?”
Combined with something like Effect, Zod, and the like and line count explode.
Criticizes · Oct 2026 · in “QGIS enacts moratorium on AI contributions”
The malware seems to inject some JS payload to execute when zod is installed
Criticizes · Oct 2026 · in “Zod 4.6.6 compromised by malware?”
now you have added a massive runtime dependency instead of local validation
Criticizes · Jul 2026 · in “TypeScript 7”
Zod was really not designed for the use-cases I want JSON schemas for
Criticizes · Nov 2025 · in “Tosijs-schema is a super lightweight schema-first LLM-native JSON schema library”
instead of zod, you should use the @standard-schema/spec package
Criticizes · Nov 2025 · in “Show HN: PrinceJS – 19,200 req/s Bun framework in 2.8 kB (built by a 13yo)”
The most recent version 4.6.6 has a very interesting commit
Criticizes · Oct 2026 · in “Zod 4.6.6 compromised by malware?”
That is 100% a compromised repo. It's a malware downloader.
Criticizes · Oct 2026 · in “Zod 4.6.6 compromised by malware?”
I haven't had any issues with zod's bundle size, and I don't see a good reason to write custom encoders/decoders everywhere.
Recommends · Jul 2026 · in “TypeScript 7”
"zod" is pretty good but you can see how trying to add that as a "keyword" is nightmare fuel for a language-level change.
Recommends · Jun 2026 · in “Parse, Don't Validate – In a Language That Doesn't Want You To”
My preferred SPA stack these days involves Porsager’s Postgres library, a simple RPC stack with Zod schemas
Recommends · Jun 2026 · in “Code duplication is far cheaper than the wrong abstraction”
the hard work that the original designers of libraries like FastAPI, Zod, Pydantic, have invested in
Recommends · Mar 2026 · in “FastAPI-compatible Python framework with Zig HTTP core; 7x faster”
I like Zod, but I already wrote the functions to progressively prove out the type in vanilla JS.
Mixed · Dec 2025 · in “Test, don't just verify”
The maintainer of Zod made sure even this kind of attack could not proceed with a publication.
Recommends · Oct 2026 · in “Zod 4.6.6 compromised by malware?”
It’s a nice pattern that gives uniformity and predictability to all of your validation logic.
Recommends · Jan 2026 · in “Notes on Starting to Use Django”
Counts from 1,795,640 Hacker News comments, Nov 2025 to Nov 2026. How we count · Report a mistake