# Ajv: 7.1 out of 10

A strong pick. 5th of 10 in [Validation libraries](https://elestia.ai/opensource/validation/index.md).

Ajv is the standard JSON Schema validator for JavaScript. It compiles schemas into very fast code and sits under Fastify, ESLint, webpack and most OpenAPI tooling. It is still the right pick when your contract is JSON Schema. For TypeScript-first validation it is a weaker choice than Zod or Valibot, and development has slowed to a few maintenance releases a year.

**Best for:** Backend and tooling teams whose contract is JSON Schema or OpenAPI and who need fast, standard-based validation, often paired with TypeBox for types.

## Scores

- **Overall: 7.1** (likely 6.0 to 8.0)
  - Claude Opus 5.5 (6.5): Ajv is still the best choice when you need standard JSON Schema validation at speed, especially with Fastify or OpenAPI, and ideally with TypeBox for types. For the category's job of checking data and giving it a type, Zod, Valibot or ArkType serve most new TypeScript projects better. Its slow maintenance and declining relative growth hold the score down.
  - GPT-6.2 Sol (7.6): Ajv is a strong pick when JSON Schema is an existing contract or validators will run repeatedly in a service. Zod is the easier default for most new TypeScript apps because its schema definitions directly infer application types. Ajv's current integrations and prompt security patching support the recommendation, while its quiet maintenance and below-baseline growth limit confidence in the longer-term outlook.
- **Needed by many: 6.1** (likely 5.0 to 7.1)
  - Claude Opus 5.5 (6.5): Most JS developers need validation, but Ajv's take on it is JSON Schema. That fits API servers, config files and OpenAPI tooling better than app-level typed validation. It runs on any runtime, but its bundle size and code generation make it a poor fit for browser forms.
  - GPT-6.2 Sol (5.6): Runtime validation is common at API, configuration, and file boundaries. Ajv is most relevant when those boundaries already use portable JSON schemas, and it works on servers and in browsers. Frontend surveys put Ajv well behind Zod, but they only partly cover the server and tooling work where Ajv fits best.
- **Helps a lot: 7.6** (likely 6.6 to 8.6)
  - Claude Opus 5.5 (7.0): Ajv is fast, covers the JSON Schema drafts and JTD, and has a large plugin ecosystem (ajv-formats, ajv-errors) and thorough docs. TypeScript support is weaker than in schema-first peers: there is no type inference without TypeBox or JSONSchemaType. Startup compile cost is high. Some users report conformance gaps in formats and oneOf error reporting on Bowtie.
  - GPT-6.2 Sol (8.1): Ajv 8.20.0 handles multiple JSON Schema drafts, returns structured errors, and is fast once a schema is compiled. Independent benchmarks show a higher startup cost, which standalone generation can move to build time. The TypeScript guide documents limits on union checking, and users report a longstanding optional-field typing problem. The range reflects how much schema complexity and startup cost vary by project, with little direct evidence on AI-generated Ajv code.
- **Holds up over time: 5.5** (likely 4.3 to 6.9)
  - Claude Opus 5.5 (5.0): Ajv is not abandoned. Version 8.18 to 8.20 shipped in 2026 with security fixes and Node 22 and 24 support. Still, there were only 8 commits last year, and the backlog is large (305 open issues, 106 open PRs). Scorecard rates Maintained at 0. It is in the OpenJS Foundation, and so much of the ecosystem depends on it that it is unlikely to vanish, but new feature work has stopped.
  - GPT-6.2 Sol (5.9): Ajv shipped three GitHub releases in the past year, including security fixes, with only eight commits and a seven-month gap since the latest release. One account published all three releases, and a longstanding typing issue remains open. Recurring donations and the long-lived v8 API help, while the undated v9 milestone and much faster development on Zod and TypeBox leave the two-year outlook uncertain.
- **Used widely: 7.6** (likely 6.4 to 8.7)
  - Claude Opus 5.5 (8.0): Ajv has the most downloads (2.1B per 4 weeks) and the most dependent repositories (1.09M) in the category, but most of that comes from build tools installing it. Its ratio of about 3.2 is below the 4.1 median, so it is losing ground, while Zod (about 8.4) and Valibot (about 15) gain. Direct choices still likely number in the hundreds of thousands, through Fastify, OpenAPI and config-validation work.
  - GPT-6.2 Sol (7.1): Ecosyste.ms found about 1.09 million dependent repositories and 14,548 dependent packages, and Ajv has about 14,900 GitHub stars. Build tools and framework defaults account for much of the 2.10 billion four-week installs, so the number of teams actively choosing Ajv is harder to estimate. Downloads grew 3.18× year over year, below the 4.1× catalog baseline and Zod's 8.40×, and the bundle shows little recent social attention.
- **Vouched for: 7.8** (likely 6.8 to 8.8)
  - Claude Opus 5.5 (7.5): Major projects run Ajv in production and build on it, including Fastify, ESLint and webpack's schema-utils, and it is the usual partner for TypeBox. Independent benchmarks keep placing it near the top for speed. It got a Mozilla MOSS grant and OpenJS backing, though those are from 2020, and current developer buzz is low.
  - GPT-6.2 Sol (8.1): Fastify uses Ajv v8 for request validation, webpack's schema-utils depends on v8.20.0, and the MCP TypeScript SDK uses it by default for JSON Schema on Node.js. Independent benchmarks confirm fast checks after compilation on the workloads they tested. Survey support is thinner and older, with 5.6% of State of Frontend 2024 respondents reporting that they used and liked Ajv and 2.2% that they used and disliked it.
- **Safe: 6.4** (likely 5.3 to 7.6)
  - Claude Opus 5.5 (6.5): Ajv has an MIT licence, 4 dependencies (fast-uri among them), and two moderate advisories, both patched. The 2026 ReDoS fix covered both the 6.x and 8.x lines, and a format prototype-pollution issue was fixed in 8.19. The OpenSSF Scorecard is weak at 4.8, scoring 0 on Pinned-Dependencies, Token-Permissions, SAST and Fuzzing, and releases are not signed. Generated code uses new Function, which matters for CSP and for untrusted schemas.
  - GPT-6.2 Sol (6.3): Ajv has an MIT licence and four direct dependencies, and v8.20.0 includes fixes for both advisories in the bundle. The February 2026 denial-of-service fix reached v8 within three days of the public advisory, with a v6 backport that month. Scorecard gives it 4.8, with weak workflow token permissions and dependency pinning, and the proposal to add npm publishing provenance is still open. The allowed fast-uri range includes patched releases, but older lockfiles can still resolve vulnerable versions and Ajv's runtime compiler assumes trusted schemas.

## Good

- It compiles schemas to JavaScript, so it is among the fastest validators on long-running servers.
- It supports JSON Schema drafts 04 through 2020-12 plus JTD, so the same schemas work in other languages and in OpenAPI.
- It is battle-tested under Fastify, ESLint, webpack and many OpenAPI tools, with over a million dependent repositories.
- MIT licence, only 4 dependencies, and recent advisories were patched in a 6.x and an 8.x release.

## Bad

- It does not infer TypeScript types from a schema by itself; you need TypeBox, JSONSchemaType or hand-written interfaces.
- Compiling schemas is slow at startup and the bundle is large, which hurts serverless, edge and browser use.
- Generated code relies on new Function, which conflicts with strict Content Security Policy unless you precompile to standalone code.
- Activity is low: 8 commits last year, more than 300 open issues and more than 100 open PRs, with no sign of a v9.

## The numbers

- Downloads, 4 weeks: 2.1B
- In a year: ×3.2
- GitHub stars: 15k
- Commits, 12 months: 8
- Last npm release: Apr 2026
- Advisories, 24 months: 1
- Licence: MIT
- GitHub: https://github.com/ajv-validator/ajv
- npm: https://www.npmjs.com/package/ajv

Many build tools install Ajv, so most downloads are not a direct choice.

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.
