TypeBox
A strong pick. 3rd of 10 validation libraries.
TypeBox builds JSON Schema objects and infers static TypeScript types from them. It also ships a fast compiled validator. It is a strong pick for APIs that need JSON Schema or OpenAPI, especially on Fastify. For general app validation with transforms and a bigger ecosystem, Zod is usually the easier choice. New projects should use the ESM-only `typebox` 1.x package. `@sinclair/typebox` 0.34 is the long-term support (LTS) line.
Best for: Backend teams whose schemas must be real JSON Schema, for Fastify, OpenAPI or Ajv, and who want fast validation.
Scores
Overall7.5
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 7.0, likely 6.0 to 8.0
It is a strong, fast and well-kept tool, and the best pick when schemas must be JSON Schema, as with Fastify and OpenAPI. For most new TypeScript apps, Zod has the larger ecosystem and the friendlier parsing API, and Valibot and ArkType are gaining ground faster. One maintainer and the package split keep it below the top of the category.
- peers downloads ratio: Zod grew 8.4x and Valibot 14.9x, against TypeBox's 2.55x
- blog.val.town/blog/typebox: Chosen next to Zod for the JSON Schema and OpenAPI layer
- github.com/sinclairzx81/typebox: Active 1.x line plus 0.x LTS
GPT-6.2 Sol: 8.0, likely 7.0 to 8.9
TypeBox is a strong pick when a new TypeScript project needs reusable JSON Schema and fast validation. Zod remains the broader default for general TypeScript validation, with more reported use and stronger download growth than the older TypeBox package. TypeBox 1.x is shipping regularly and growing quickly, while its smaller documented user base and reliance on one listed maintainer keep the range wide.
- schemabenchmarks.dev/json-schema/compliance/validation?sortBy=compliance&sortDir=descending&target=draft2020-12: Current version scores highly on JSON Schema conformance
- 2025.stateofreact.com/en-US/other-tools/#validation_libraries: Zod leads reported use among React survey respondents
- peers.Zod, npm.downloadsLast4Weeks, npm.downloadsSame4WeeksYearAgo: Zod grew 8.4 times versus 2.55 times for scoped TypeBox
- bellwether.report/npm/typebox: Current npm package is growing quickly from a small base
- security.snyk.io/package/npm/typebox: Recent release cadence and one listed maintainer
Needed by many6.9
How many developers need a tool for this job?
Claude Opus 5.5: 7.0, likely 6.0 to 8.0
Most TypeScript projects need runtime validation. TypeBox's JSON-Schema-first approach fits backend and API work best, and front-end form work less. That makes its audience somewhat narrower than the whole category.
- betterstack.com/community/guides/scaling-nodejs/typebox-vs-zod: Recommends TypeBox for APIs that need JSON Schema and OpenAPI, and Zod for full-stack apps
- fastify.dev/docs/latest/Reference/Type-Providers: Fastify's type provider docs build on TypeBox
GPT-6.2 Sol: 6.7, likely 5.6 to 7.8
Runtime validation is useful for API requests, forms, configuration, and external data. TypeBox works without a framework, and its main advantage is strongest when another tool also consumes the JSON Schema. The available survey covers React developers, so it gives a limited view of demand across JavaScript and TypeScript projects.
- 2025.stateofreact.com/en-US/other-tools/#validation_libraries: Survey respondents widely report using schema validation
- npmjs.com/package/typebox?activeTab=readme: Framework-independent runtime validation and native JSON Schema
Helps a lot8.1
How well does it do the job for those who need it?
Claude Opus 5.5: 7.5, likely 6.5 to 8.5
Its schemas are standard JSON Schema, its type inference is precise, and its compiled validator is among the fastest. It is weaker at transforms and parsing than Zod, and its error messages are less friendly. Users also report that AI agents get its API wrong without reference docs. The 1.x API renames add some friction.
- blog.val.town/blog/typebox: Val Town uses it because its validators mirror JSON Schema exactly and it is fast
- github.com/alexilyaev/typescript-runtime-type-benchmarks: Independent benchmark suite where TypeBox's compiled validator ranks near the top
- bluesky top posts: A user says models hallucinate the TypeBox API without reference docs
- github.liu-huaimin.workers.dev/sinclairzx81/typebox/blob/main/changelog/1.0.0-migration.md: 1.0 is ESM-only, renames TypeCheck to Validator and replaces symbols
GPT-6.2 Sol: 8.6, likely 7.6 to 9.4
TypeBox 1.4.7 combines precise inference with native JSON Schema and passes 99% of the independent draft 2020-12 test run. Its compiled check was about as fast as compiled Zod on the benchmark's invalid input. Users report friction with shared schema references and AI-generated examples. The benchmark measures specific workloads, and the reports on coding agents are anecdotal.
- schemabenchmarks.dev/json-schema/compliance/validation?sortBy=compliance&sortDir=descending&target=draft2020-12: TypeBox 1.4.7 passed 99% of the test cases
- schemabenchmarks.dev/validation?dataType=invalid&sortBy=mean&sortDir=ascending: Compiled TypeBox and Zod checks took 48 and 47 ns
- github.com/sinclairzx81/typebox/discussions/1458: Users worked around shared schema reference changes
- bluesky.top: A user reports that coding agents need current documentation
Holds up over time6.9
Will it still be a good choice in two years?
Claude Opus 5.5: 6.5, likely 5.0 to 7.5
The project is active: 211 commits and 30 npm versions in the last year, and zero open issues. A 0.x LTS line is promised through 2026 and beyond. Against that, one developer drives almost all the work, so the bus factor is high. The 1.x move to a new package name and ESM only splits the user base.
- github commitsLastYear: 211 commits; issues closed promptly (0 open, 886 closed)
- npm versionsLastYear: 30 releases of the 0.34 line in the last year
- github.com/sinclairzx81/typebox: 1.x is the latest line and is ESM-only; 0.x is under long-term support in a separate repository
- socket.dev/npm/package/@sinclair/typebox/overview/0.34.45: Pre-1.0 versions will keep active maintenance through 2026 and beyond
GPT-6.2 Sol: 7.3, likely 6.0 to 8.6
The repository logged 211 commits in the past year, and the 1.x package shipped four updates in November. The project maintains a 0.x support line and responded to a reported parsing regression in 1.1. One listed npm maintainer and user-reported migration work make the two-year outlook less certain.
- github.commitsLastYear: 211 commits in the past year
- security.snyk.io/package/npm/typebox: Four November releases and one listed npm maintainer
- npmjs.com/package/%40sinclair/typebox?activeTab=versions: The 0.x package remains on long-term support
- schemabenchmarks.dev/blog/7-month-update: Version 1.1 made automatic coercion opt-in
- github.com/sinclairzx81/typebox/discussions/1458: Migration required reworking shared schema references
Used widely6.7
How many use it, and is that growing?
Claude Opus 5.5: 6.5, likely 5.5 to 7.5
The 657M downloads per 4 weeks and 708k dependent repositories are inflated, because Jest's @jest/schemas installs TypeBox for most of its users. The growth ratio of 2.55 is below the 4.1 median and far below Zod's and Valibot's, although the downloads of the new `typebox` package are not counted here. Direct choices, mostly through Fastify, are likely in the tens to low hundreds of thousands. Bluesky and Hacker News attention is low next to Zod and ArkType.
- npm downloadsLast4Weeks: 656.6M now against 257.2M a year ago, a ratio of 2.55 against a 4.1 median
- dependents repos: 707,802 repositories, much of it through Jest
- bluesky posts: 4 posts, against Zod's 32 and ArkType's 88
- @jest/schemas dependency: Jest depends on @sinclair/typebox, which inflates its downloads
GPT-6.2 Sol: 6.9, likely 5.5 to 8.2
The older package grew 2.55 times year over year, below the 4.1 median, and many of its installs come through other tools. The current package reached 16.7 million downloads in one November week, up sharply from a small base a year earlier. The older package's roughly 708,000 indexed dependent repositories show substantial reach, while the React survey and peer attention favor Zod. Direct adoption of 1.x is still hard to estimate from installs and counts that cover different package generations.
- npm.downloadsLast4Weeks, npm.downloadsSame4WeeksYearAgo, medianDownloadsRatio, project.note: Scoped package grew 2.55 times against a 4.1 median
- dependents.repos, github.stars, bluesky.posts, peers: Large legacy footprint with less public attention than Zod
- bellwether.report/npm/typebox: Unscoped package reached 16.7 million weekly downloads
- 2025.stateofreact.com/en-US/other-tools/#validation_libraries: Zod had far more mentions among React respondents
Vouched for7.2
Who stands behind it being good?
Claude Opus 5.5: 6.5, likely 5.5 to 7.5
Fastify officially supports it as a type provider, and companies such as Val Town have written about running it in production. Independent benchmarks also rate it well. It has little presence in developer surveys, and much of the public praise is from 2024–2025.
- npmjs.com/package/@fastify/type-provider-typebox: Official Fastify type provider for TypeBox
- blog.val.town/blog/typebox: Production use at Val Town, with its reasons (2024)
- betterstack.com/community/guides/scaling-nodejs/typebox-vs-zod: Independent comparison that recommends it for JSON Schema and OpenAPI APIs
GPT-6.2 Sol: 7.8, likely 6.6 to 8.8
Fastify supports TypeBox 1.x through its official type provider, and Elysia builds its route schema API on TypeBox and documents 1.x for Elysia 2. Independent testing confirms strong standards compliance on the current release. Public evidence on long-term production use and satisfaction with 1.x remains limited.
- github.com/fastify/fastify-type-provider-typebox/releases: Fastify's official provider shipped support for TypeBox 1.x
- elysiajs.com/patterns/typebox: Elysia builds its route schema API on TypeBox
- next.elysiajs.com/patterns/typebox: Elysia 2 documentation names TypeBox 1.x
- schemabenchmarks.dev/json-schema/compliance/validation?sortBy=compliance&sortDir=descending&target=draft2020-12: Independent conformance results for the current stable release
Safe7.6
How safe is it to depend on?
Claude Opus 5.5: 7.5, likely 6.5 to 8.5
It has zero dependencies, an MIT licence and no known advisories. The OpenSSF Scorecard is only 5. Code-Review, Branch-Protection and Token-Permissions all score 0, which fits a single maintainer who publishes without review.
- npm dependencies: 0 dependencies; MIT licence
- advisories total: No advisories recorded in OSV
- scorecard: Score 5; Code-Review, Branch-Protection and Token-Permissions are 0
GPT-6.2 Sol: 7.6, likely 6.4 to 8.7
TypeBox 1.4.7 has an MIT license, zero runtime dependencies, and no known published advisories affecting it. A July code injection advisory missing from the bundle affected 0.x, and patches for the affected branches shipped within two days. GitHub Actions publishes with npm provenance, while the package has one listed maintainer. OpenSSF's 5 out of 10 score and weak marks for review, branch protection, token permissions, and fuzzing leave uncertainty about release safeguards.
- npmjs.com/package/typebox?activeTab=dependencies: MIT license and zero runtime dependencies in 1.4.7
- security.snyk.io/package/npm/typebox: One listed maintainer and no known 1.4.7 vulnerabilities
- github.com/sinclairzx81/sinclair-typebox/security/advisories/GHSA-976x-prgx-qv35: Legacy compiler issue received prompt patches and did not affect 1.x
- github.com/sinclairzx81/typebox/blob/main/.github/workflows/publish.yml: Tag-triggered GitHub Actions publication with npm provenance
- scorecard: 5 out of 10 with several weak development safeguards
Good
- Schemas are plain JSON Schema, so the same definition drives validation, OpenAPI docs and static types.
- The compiled validator is among the fastest in independent benchmarks, and the package has zero dependencies.
- It is Fastify's main type provider, and Hono and other server tools have adapters for it.
- The 0.x LTS line keeps both CJS and ESM, while 1.x targets the TypeScript 7 native compiler.
Bad
- One person maintains and publishes it, so the project depends heavily on him.
- The split between `@sinclair/typebox` 0.34 and the ESM-only `typebox` 1.x, with renamed APIs, confuses users and AI agents.
- Transforms, coercion and custom refinements are clumsier than in Zod or Valibot.
- AI coding agents often get its API wrong without reference docs, and it has a smaller tutorial and integration ecosystem than Zod.
The numbers
- npm downloads, 4 weeks
- 657M ×2.6 in a year
- GitHub stars
- 7k
- Commits, 12 months
- 211
- npm version
- 0.34.52 Jul 2026
- Versions, 12 months
- 30
- Advisories, 24 months
- 0 of 0 ever
- OpenSSF Scorecard
- 5.0 out of 10, Oct 2026
- Licence
- MIT
TypeBox 1 is published as the package typebox. These numbers are of the older @sinclair/typebox, which still has about 10 times the downloads because other tools install it.
Read on 21 November 2026 from GitHub (sinclairzx81/typebox), npm (@sinclair/typebox), OSV and the OpenSSF Scorecard.