Library / SDK
arktypeio/arktype avatar
arktypeio/arktype

ArkType: TypeScript's 1:1 Validator, From Editor to Runtime

TypeScript's 1:1 validator, optimized from editor to runtime

7,872 stars166 forksTypeScriptMIT

At a glance

What is it?
ArkType parses runtime validators from the same type syntax you already write, so a JSON payload check and its static type come from one expression. Here is what the repository states, and where it stops being the right tool.
Who is it for?
Adopt ArkType if your team already lives in TypeScript's type syntax and wants one expression to serve as both the static type and the runtime check at a JSON or form boundary, and if you are willing to read the docs site rather than the README, which is mostly contribution and sponsorship material.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 2, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The boundary problem ArkType targets

TypeScript types disappear at compile time. Every JSON payload, form submission or queue message that crosses into your process is untyped at the moment it matters, and the type annotation you put on the receiving function is a promise the compiler cannot check. The usual fix is to write the shape twice: once as a type, once as a validator that walks the value at runtime. The two drift, and the drift is silent until production.

ArkType's pitch, stated in its own description, is "TypeScript's 1:1 validator, optimized from editor to runtime." The README frames the use case plainly: it can check external data like JSON payloads or forms at the boundaries of your code, and it notes the comparison to Zod. So the audience is TypeScript application developers who own an ingestion point: an HTTP handler, a webhook receiver, a config loader, a form parser. If your data never leaves a typed function call, you are not the target.

How a validator is parsed from type syntax

The README describes parsing: ArkType reads validators out of familiar, type-safe syntax rather than asking you to compose a validator object graph by hand. The expression you write is the schema, and the same expression is what the editor sees as a type. That is the "1:1" in the tagline, and it is the design decision everything else follows from.

The repository layout supports the claim about scope. The workspace is a pnpm monorepo with a top-level ark/ directory, a pnpm-workspace.yaml and a root package.json whose name is ark and which is marked private. The root scripts show the project is built and tested as a set of packages, not a single file: build runs pnpm -r across the workspace, and buildCjs re-runs the same build with ARKTYPE_CJS=1 for CommonJS output. The release list shows the published artefacts are versioned separately, with [email protected], [email protected] and @arktype/[email protected] all tagged on the same day. That split matters if you plan to depend on internals: the regex and util packages are their own release trains, so pinning them is a separate decision from pinning arktype.

The benchmark script in package.json is worth noting for a different reason. It runs six separate benchmark groups (benchOperand, benchOperator, benchNary, benchObject, benchMatch, benchCyclic) and sets ATTEST_benchErrorOnThresholdExceeded to "types". That tells you the maintainers treat type-level performance as something that can regress and fail a check, not just runtime speed. It does not tell you the numbers, and the README publishes none.

Installing ArkType and validating a first payload

The README does not carry install instructions; it points to the docs site at arktype.io for documentation. The published package name is arktype, which is what npm search traffic for "arktype npm" is looking for. Install it from the npm registry with the command below, then follow the docs site for the validator syntax:

bash
npm install arktype

After that, the pattern is to define a validator and call it on unknown input. The docs site is where the full syntax reference lives, so confirm the exact call signature there before shipping anything. What you should see when a value passes is data you can narrow; when it fails, an error carrying the problem. The error format is the part to inspect first, because it is what your logs and your API responses will carry.

If you are wiring this into a form or an HTTP handler, keep the validator next to the handler rather than in a shared types file. The whole point of deriving the type from the validator is that there is one place to change.

Where the 1:1 approach costs you

Deriving runtime behaviour from type syntax is elegant until the type syntax cannot express what you need. TypeScript's type language has no place to put a custom error message, no place to describe a transform, and no place to hang a coercion rule. Anything of that sort has to live in a separate API surface, which means the mental model is not quite one expression for every schema. Simple shapes stay clean; schemas with business rules accumulate a second layer.

The second cost is the editor itself. The README is candid that depending on your familiarity with type systems and TypeScript generics, some parts of the codebase may be hard to jump into. That is a statement about contributing, but it reflects the library's surface too: the same generic machinery that produces precise inferred types is what produces error messages when a schema is wrong. Deeply nested or recursive schemas are where you should expect to spend time reading the docs rather than guessing.

The third cost is that the README is thin. It covers docs, contributions, licence, code of conduct and sponsorship, and little else. There is no migration guide, no changelog summary, and no rollback guidance in the README. Upgrade notes for a major version are something you will have to find on the docs site or in the release history, not in the file at the repository root.

ArkType compared with Zod, Valibot and TypeBox

The comparison people actually search for is arktype vs zod, and the honest difference is the entry point. Zod asks you to build a schema by composing validator functions: z.object, z.string, z.number. The schema is a value you construct, and the TypeScript type is inferred from it. ArkType asks you to write something closer to a type literal and parses a validator out of it. Both end with a type and a runtime check; they arrive from opposite directions.

That difference shows up in two places. First, error messages and coercion are first-class in Zod's API because the schema is a value with methods, whereas in ArkType they are a separate concern from the type expression. Second, the ecosystem: Zod's schema objects are the input format that many other tools accept, so integrations are copy-paste. With ArkType you are more likely to write the adapter yourself.

Valibot takes a third position, closer to Zod's function composition but built around tree-shakable small functions. If bundle size is your constraint, that is the axis to compare on, and you should measure it against your own build rather than trusting a table. TypeBox takes a fourth: it builds JSON Schema, which is useful when the schema itself needs to be a portable artefact consumed by something outside your process. ArkType's schema is a TypeScript expression, not a JSON document, so if you need to hand the schema to a non-TypeScript service, TypeBox is the more natural fit.

Maintenance, licence and upgrade cost

The repository is not archived, and the last push was on 2026-09-19. The most recent release tags are [email protected], [email protected] and @arktype/[email protected], all dated 2026-07-07. So there is a gap between the last release and the last commit, which is normal for a project that commits ahead of its tags.

The README states the maintainers have been working full-time on the project for multiple years and that it is funded through GitHub Sponsors, with a named sponsor (get-convex) and several individual sponsors listed. That is a funding model worth understanding before you depend on it: the project is not backed by a company selling a hosted version, so its continuity is tied to sponsorship and to the maintainers' own commitment. Nothing in the README states a support SLA or a release cadence commitment.

The licence is MIT, stated in the README and in the root package.json. MIT is permissive: it allows commercial use, modification and redistribution with the licence text retained. That is a statement about what the licence says, not legal advice, and your own review should confirm the text in ./LICENSE. Because the workspace publishes several packages under one repository, check the licence field of each package you actually depend on rather than assuming the root applies to all of them.

Editorial conclusion

Adopt ArkType if your team already lives in TypeScript's type syntax and wants one expression to serve as both the static type and the runtime check at a JSON or form boundary, and if you are willing to read the docs site rather than the README, which is mostly contribution and sponsorship material. Do not adopt it if you need a validator whose error output and ecosystem integrations you can copy from a decade of Stack Overflow answers, or if your data shapes are simple enough that a hand-written guard costs less than a new dependency. Before committing, verify the version you install against the release list ([email protected] is the most recent tag), confirm the MIT licence text in ./LICENSE matches what your legal review expects, and run one real payload through a validator in a scratch file to see the error format your logs will carry.

Frequently asked questions

What are some alternatives to Zod?

ArkType is one, and it differs in entry point: it parses a validator from familiar, type-safe syntax rather than composing validator functions into a schema object. Valibot and TypeBox are other options, with TypeBox building JSON Schema instead of a TypeScript expression.

How does ArkType compare with Zod?

Zod builds a schema by composing validator functions and infers the type from it, while ArkType parses a validator out of familiar, type-safe syntax. Coercion and custom error messages are part of Zod's schema API, whereas in ArkType they sit outside the type expression.

How does ArkType compare with TypeBox?

TypeBox builds JSON Schema, so the schema is a portable artefact that non-TypeScript services can consume. ArkType's schema is a TypeScript expression, which keeps the static type and the runtime check in one place but is not a JSON document you can hand to another language.

How does ArkType compare with Zod 4?

The README does not discuss Zod 4 specifically. It describes ArkType as parsing validators from type-safe syntax and notes the comparison to Zod as a boundary-checking library, so any version-to-version comparison has to come from the docs site at arktype.io.

How does ArkType compare with Zod on performance?

The README publishes no benchmark numbers, and the description only calls the validators optimized from editor to runtime. The repository's bench script runs six groups (benchOperand, benchOperator, benchNary, benchObject, benchMatch, benchCyclic), so any performance claim should come from running those against your own data.

Official sources

  1. arktypeio/arktype on GitHub
  2. License: MIT
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/arktypeio-arktype.svg)](https://hysenlabs.com/projects/arktypeio-arktype)