# Validation libraries

Check that data has the expected shape, and give it a type. Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 21 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.

| Rank | Project | Overall | Needed by many | Helps a lot | Holds up over time | Used widely | Vouched for | Safe | Best for |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | [Zod](https://elestia.ai/opensource/validation/zod/index.md) | 9.0 | 8.3 | 8.7 | 8.3 | 9.0 | 8.9 | 6.7 | Any TypeScript team that wants one schema to give both runtime validation and static types, with the widest ecosystem of integrations. |
| 2 | [Valibot](https://elestia.ai/opensource/validation/valibot/index.md) | 7.9 | 8.1 | 8.3 | 7.3 | 6.2 | 6.8 | 8.4 | Teams shipping validation to browsers, edge functions or shared libraries, where bundle size and speed matter more than having the largest ecosystem. |
| 3 | [TypeBox](https://elestia.ai/opensource/validation/typebox/index.md) | 7.5 | 6.9 | 8.1 | 6.9 | 6.7 | 7.2 | 7.6 | Backend teams whose schemas must be real JSON Schema, for Fastify, OpenAPI or Ajv, and who want fast validation. |
| 4 | [ArkType](https://elestia.ai/opensource/validation/arktype/index.md) | 7.2 | 7.1 | 7.9 | 7.1 | 4.8 | 5.9 | 8.2 | TypeScript teams that want the fastest runtime validation and schemas that read like TypeScript types, and that can accept a larger bundle. |
| 5 | [Ajv](https://elestia.ai/opensource/validation/ajv/index.md) | 7.1 | 6.1 | 7.6 | 5.5 | 7.6 | 7.8 | 6.4 | Backend and tooling teams whose contract is JSON Schema or OpenAPI and who need fast, standard-based validation, often paired with TypeBox for types. |
| 6 | [Joi](https://elestia.ai/opensource/validation/joi/index.md) | 6.2 | 7.0 | 6.8 | 6.5 | 6.6 | 6.8 | 6.3 | JavaScript-first Node.js back ends, especially hapi apps or codebases that already use Joi and need rich rules and customizable error messages. |
| 7 | [class-validator](https://elestia.ai/opensource/validation/class-validator/index.md) | 5.6 | 4.8 | 6.0 | 4.4 | 6.0 | 6.2 | 5.9 | NestJS teams that want DTO classes with the built-in ValidationPipe and the patterns in the official docs. |
| 8 | [Yup](https://elestia.ai/opensource/validation/yup/index.md) | 5.2 | 7.7 | 6.4 | 3.6 | 6.1 | 6.1 | 6.1 | Teams that already run Yup, often with Formik, and want to keep their existing form schemas. |
| 9 | [Superstruct](https://elestia.ai/opensource/validation/superstruct/index.md) | 3.9 | 7.2 | 5.8 | 2.4 | 4.6 | 4.2 | 6.2 | Existing codebases that already use Superstruct and want a tiny validator with no dependencies; new projects should pick Valibot or Zod. |
| 10 | [io-ts](https://elestia.ai/opensource/validation/io-ts/index.md) | 3.8 | 5.2 | 6.0 | 2.4 | 4.4 | 3.9 | 6.1 | Existing fp-ts codebases that already use io-ts codecs and are not yet ready to migrate to Effect Schema. |

## The numbers

| Project | Downloads, 4 weeks | In a year | GitHub stars | Commits, 12 months | Last npm release | Advisories, 24 months |
| --- | --- | --- | --- | --- | --- | --- |
| Zod | 1.8B | ×8.4 | 44k | 576 | Oct 2026 | 1 |
| Valibot | 132M | ×15 | 9.1k | 437 | Sept 2026 | 2 |
| TypeBox | 657M | ×2.6 | 7k | 211 | Jul 2026 | 0 |
| ArkType | 13M | ×8.5 | 7.9k | 4.6k | Nov 2026 | 0 |
| Ajv | 2.1B | ×3.2 | 15k | 8 | Apr 2026 | 1 |
| Joi | 136M | ×2.4 | 21k | 79 | Nov 2026 | 6 |
| class-validator | 70M | ×3.2 | 12k | 16 | Feb 2026 | 0 |
| Yup | 65M | +92% | 24k | 0 | Sept 2025 | 0 |
| Superstruct | 38M | ×3.0 | 7.1k | 0 | Jul 2024 | 0 |
| io-ts | 15M | ×2.1 | 6.8k | 0 | Dec 2024 | 0 |

All categories: https://elestia.ai/opensource/index.md
