Skip to content

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 · comment

    Whenever I write an API I'll use Zod and whatever middlewares my framework needs to generate json schema for consumers

    May 2026 · comment

    it can be significantly improved upon by using a library to verify the structure of deserialized data

    Nov 2025 · comment
  • Ergonomic and easy to use · 5

    Zod is by far the most ergonomic way to express those ideas in TypeScript these days.

    Jun 2026 · comment

    Zod is more ergonomic, has easier apis and is perfect for most users

    Jun 2026 · comment

    Found it pretty easy to use, and it's helped clean things up a good bit

    Aug 2026 · comment
  • Generates 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 · comment

    I'm a fan of using satisfies to check Zod definitions against the interfaces they validate.

    Nov 2025 · comment

    which I'd say shines in representing typescript's type system in code

    Jun 2026 · comment
  • Works well with TypeScript frontends · 3

    I've got it well integrated with Zod for type safe JS/TS front-ends as well.

    Mar 2026 · comment

    using Hono + Zod has been brilliant for creating types that my frontend can consume

    Feb 2026 · comment

    we 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 · comment

    now you have added a massive runtime dependency instead of local validation

    Jul 2026 · comment

    how much code is spent simply producing an enormous amount of Zod schemas and unit tests around them

    Sep 2026 · comment
  • Security 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 · comment

    It definitely doesn't inspire confidence in the project taking security seriously.

    Oct 2026 · comment

    The malware seems to inject some JS payload to execute when zod is installed

    Oct 2026 · comment
  • Inferred types hurt IntelliSense · 2

    then have to deal with the inferred types which among other things tend to suck for IntelliSense etc.

    Jun 2026 · comment

    it's a lot easier to work with types you've declared in TypeScript than the ones Zod generates

    Nov 2025 · comment
  • Poor fit for some use cases · 3

    Zod was really not designed for the use-cases I want JSON schemas for

    Nov 2025 · comment

    Zod is quite unpleasant to use, IME, an has some edge cases where you lose code comments.

    Nov 2025 · comment

    instead of zod, you should use the @standard-schema/spec package

    Nov 2025 · comment

What hackers pick instead

Every quote

The 40 most detailed of 91 comments. Each links to the original.

  1. 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”

  2. 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”

  3. 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”

  4. 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”

  5. 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)”

  6. 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)”

  7. 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”

  8. using Hono + Zod has been brilliant for creating types that my frontend can consume

    Recommends · Feb 2026 · in “Ship Types, Not Docs”

  9. 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”

  10. 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”

  11. 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)”

  12. which I'd say shines in representing typescript's type system in code

    Recommends · Jun 2026

  13. 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”

  14. 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)”

  15. If you just slap in Zod, the server will drop the extra inputs.

    Recommends · Dec 2025 · in “GraphQL: The enterprise honeymoon is over”

  16. In JS, libraries like Zod and Valibot are a dream to work with.

    Recommends · Nov 2025 · in “How I fell in love with Erlang”

  17. 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”

  18. 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”

  19. the value of letting the schema do a lot of the guarding

    Recommends · Jul 2026 · in “TypeScript 7”

  20. 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”

  21. 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”

  22. 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?”

  23. 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?”

  24. 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)”

  25. 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”

  26. It definitely doesn't inspire confidence in the project taking security seriously.

    Criticizes · Oct 2026 · in “Zod 4.6.6 compromised by malware?”

  27. Combined with something like Effect, Zod, and the like and line count explode.

    Criticizes · Oct 2026 · in “QGIS enacts moratorium on AI contributions”

  28. 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?”

  29. now you have added a massive runtime dependency instead of local validation

    Criticizes · Jul 2026 · in “TypeScript 7”

  30. 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”

  31. 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)”

  32. The most recent version 4.6.6 has a very interesting commit

    Criticizes · Oct 2026 · in “Zod 4.6.6 compromised by malware?”

  33. That is 100% a compromised repo. It's a malware downloader.

    Criticizes · Oct 2026 · in “Zod 4.6.6 compromised by malware?”

  34. 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”

  35. "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”

  36. 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”

  37. 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”

  38. 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”

  39. 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?”

  40. 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