zod
TypeScript-first schema validation with static type inference (by colinhacks)
Yup
Dead simple Object schema validation (by jquense)
zod | Yup | |
---|---|---|
362 | 127 | |
37,354 | 23,324 | |
4.2% | 0.5% | |
8.9 | 5.8 | |
4 days ago | 5 days ago | |
TypeScript | TypeScript | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
zod
Posts with mentions or reviews of zod.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2025-04-28.
-
Welcome Sury - The fastest schema with next-gen DX 🚀
I'm a big fan of Zod and find it the best choice regarding the ecosystem and developer experience it provides. Although, despite its large size, it's tailored more toward the frontend world. If you're developing a backend or an application with high throughput, you should definitely give Sury a try.
-
Building a Real-Time Chat App with Firebase and Next.js
In this project, we take a code-first approach when working with Firestore. Instead of relying on Firestore rules or ad-hoc validation, we define the shape and structure of a valid message directly in our application code using Zod.
-
Build a RAG Chat App with Firebase Genkit and Astra DB
The next thing to do is write our first Genkit flow to ingest data from a URL into the collection. Flows are functions that you can run via the Genkit UI or through code. Flows have strongly defined input and output schemas using zod.
-
Leveraging the TS type system with APIs: Validation, error handling and free OpenAPI specs
Zod seems to be the go-to validation library, and is very useful in some contexts, for example if you need to do more complex or nested runtime validation. But this won't generate API docs or give you error handlers or API controllers.
-
TypeScript Types Lie & How to Improve Them
Leveraging type narrowing helper libraries like Zod or ArcType can significantly both reduce the type narrowing you need to do know parsing outside data, reduce lots of boilerplate type narrowing code, and increase type safety. Many of the type lies TypeScript tells are from JSON.parse, converting Errors typed as unknown, or when reading local configuration files. This is where Zod/ArcType can really make a huge positive impact.
-
Generating & Building The OpenAI SDK With Stainless & Speakeasy
While Speakeasy also includes unit tests, they're organized at the root of the /tests directory with less granular separation. Its approach emphasizes documentation and type definitions, with extensive model documentation in /docs/models/. The SDK uses runtime validation through zod, which requires developers to carefully handle error objects when the API returns invalid data. This creates a different balance between compile-time and runtime type safety.
- All in on CLINE
-
Build a Datadog alternative in 5 minutes
I used zod-bird to integrate Tinybird APIs (pipes and events) with Next.js. It's a wrapper around the Tinybird APIs that validates pipe results using zod schemas.
-
JavaScript schema library from the Future 🧬
One of the most basic applications of ReScript Schema is parsing - Accepting unknown JavaScript data, validating it, and returning the result of your desired type. There are dozens of such libraries, and the most popular ones are Zod, Valibot, Runtypes, Arktype, Typia, Superstruct, Effect Schema, and more. Also, even though this is slightly different, validation libraries like Ajv, Yup, and others also stand really close.
-
Error Handling for fetch in TypeScript
…but that’s a lot of no fun, dangerous work. Better to use a library that has already solved this problem like Zod or ArkType. It’ll ensure the types match up, and if not, give you an error response that _somewhat_ gives you a clue as to why the decoding went wrong, way more thorough and verbose than JSON.parse’s not so great runtime error messages.
Yup
Posts with mentions or reviews of Yup.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2025-04-14.
-
Validações com biblioteca Yup
NPM github/yup
-
How to use Yup validation with React Hook Form
Yup is a schema builder for JavaScript applications, it allows you to validate data against a schema and transform data in your applications easily. It was originally inspired by Joi, a popular validation library, but Yup is optimized for client-side use, making it perfect for form validation with React.
-
Formik & React (Part 3): Validation with yup & Streamlining Code
So far, we have managed the state of our order submission form, validated our form fields, displayed error messages,handled form submission, and tracked visited fields. However, there is an even better way to carry out form validation, and that is through the use of a library known as yup. With yup, we can eliminate manual interference from our validate function.
-
JavaScript schema library from the Future 🧬
One of the most basic applications of ReScript Schema is parsing - Accepting unknown JavaScript data, validating it, and returning the result of your desired type. There are dozens of such libraries, and the most popular ones are Zod, Valibot, Runtypes, Arktype, Typia, Superstruct, Effect Schema, and more. Also, even though this is slightly different, validation libraries like Ajv, Yup, and others also stand really close.
-
Top 20 Modern React Libraries To Supercharge Your Next Big Project
Resource: Yup GitHub
- "yup" is the new extra virgin olive oil
-
Validate Email Address Format and Domain Libraries for Use in Next.js
Yup
-
VineJS vs. Zod for schema validation
Because of its ease of usage, Yup is well-liked and frequently used in front-end validation, particularly when combined with React and tools like Formik. Compared to VineJS or Zod, it might not function as well with complex structures, but its chainable API makes developing schemas simple.
-
Building Forms in React.js : A beginners guide
For ease of work, you must use Yup package to smoothly Validate the form data. It is a very popular package used with Form Libraries like React-Hook-Form or Formik. Yup Docs: https://www.npmjs.com/package/yup
-
How To Verify Forms Using Formik in React js
You can study more about Formik here and Yup here.
What are some alternatives?
When comparing zod and Yup you can also consider the following projects:
class-validator - Decorator-based property validation for classes.
joi - The most powerful data validation library for JS [Moved to: https://github.com/hapijs/joi]
typebox - Json Schema Type Builder with Static Type Resolution for TypeScript
ajv - The fastest JSON schema Validator. Supports JSON Schema draft-04/06/07/2019-09/2020-12 and JSON Type Definition (RFC8927)
Superstruct - A simple and composable way to validate data in JavaScript (and TypeScript).