TypeScript's smallest, fastest validator. One prompt away.

Level up your Zod schemas.

Get started

Speed. Size. Startup.

Three metrics. Zero compromises.

Other projects' benchmarks, in the units they measure. Shorter is better.

Validation speed

1st

CPU instructions per validation · 22 results from 2 other projects' benchmarks

  1. 1stArkType658123 ns · 8.1M validations a second on our benchmark
  2. 2ndTypia794 ns2,097
  3. 3rdValibot1,875 ns5,647
  4. 4thTypeBox3,207 ns7,832
  5. 02 more between
  6. 5thZod2,012 ns10,044

1st of the 5 libraries that ran all 22 resultswatch live ↓

Bundle size

1st

kB gzipped · valibot.dev's login form and schemabenchmarks.dev's download

  1. 1stArkType1.19 kB0.92 kB on Valibot's login form · 27× smaller than Zod
  2. 2ndTypia1.52 kB
  3. 3rdajv1.59 kB
  4. 4thSuperstruct1.77 kB
  5. 57 more between
  6. 10thZod24.7 kB, past the end of the axis

1st of the 12 libraries that ran both resultswatch live ↓

Startup

1st

CPU instructions to create a schema · 2 results from 2 other projects' benchmarks

  1. 1stArkType380.69M instructions on our login app · 63× fewer than Zod
  2. 2ndTypeBox4,273
  3. 3rdValibot14,801, past the end of the axis
  4. 4thsury119k, past the end of the axis
  5. 02 more between
  6. 5thZod895k, past the end of the axis

1st of the 6 libraries that ran both resultswatch live ↓

past the axis: the bar is cut, the number is exact@ark/aot default build, in all threehow we measured →

Every number on the board, a library a row.

libraryspeedstartupsize
ArkType658381.19 kB
Typia2nd2,097—2nd1.52 kB
Valibot3rd5,6473rd14,8015th1.79 kB
TypeBox4th7,8322nd4,2739th17.6 kB
Zod5th10,0445th895k10th24.7 kB
sury—4th119k—
Zod (compiled)—6th1.18M—
ajv——3rd1.59 kB
Superstruct——4th1.77 kB
runtypes——6th4.94 kB
Zod Mini——7th5.91 kB
Yup——8th13.3 kB
Effect Schema——11th44.6 kB
Joi——12th53.8 kB

speed: CPU instructions per validationstartup: CPU instructions to create a schemasize: kB gzipped— didn't run every result that graph averageshow we measured →

01// write

Same type. Now it runs.

TypeScript syntax, in a string. Autocomplete, hover types and squiggles as you type — and the inferred type is the one you'd have written.

user.ts·the same six lines
interface User {
	name: string
	email: string
	age?: number
	role: "admin" | "member"
}
const 
const User: Type<{
    name: string;
    email: string;
    role: "admin" | "member";
    age?: number;
}>
User
= type({
name: "string", email: "string.email", "age?": "number.integer >= 0", role: "'admin' | 'member'" })

two lines TypeScript can't check, now checked

User({ name: "Ada", email: "ada@", age: -1, role: "admin" })email must be an email addressage must be non-negative
02// live benchmarks

Mind the gap.

15×faster than Zod 4, at the median scenario

32 scenarios against Zod 4. 32 wins.

5.3× faster than Zod's own z.compile at the median, too.

validated in the same time
  1. ArkTypeprecompiled
  2. Zod (compiled)5.3× the time per call
  3. Valibot13× the time per call
  4. Zod15× the time per call
  5. Zod Mini29× the time per call
slowed to read · each library at its median across the 32 scenarios

Where it loses. It isn't the fastest at everything. On the rows that report errors for invalid data, ajv was faster on 8 of 15.

how we measured →

A bar is a library's median scenario. Under it: its closest scenario, its farthest, and how many it was slower on.

  1. ArkType (precompiled)1×
  2. ArkType (dynamic)1.05× slower0.89× to 129× · slower in 18/32
  3. Zod (compiled)5.3× slower1.32× to 208× · slower in 32/32
  4. Valibot13× slower2.3× to 197× · slower in 32/32
  5. Zod15× slower3× to 259× · slower in 32/32
  6. Zod Mini29× slower3× to 288× · slower in 32/32

median of 32 scenarios · times slower than ArkType · shorter is better

ajv is faster where the hot path reports errors: on 8 of 15 such rows.

We raced it against the ahead-of-time compilers (typia, TypeBox, ajv) and the libraries you'd otherwise write schemas with (Zod 4, compiled or not, and Valibot), on the same inputs. On valid data, no other library was faster in more than 1 of 16 valid-data scenarios.

1 of 16

valid-data scenarios is the most any one library beat precompiled ArkType on: ajv on items defaults (1.45×). ArkType was fastest in 15.

ajv

was faster on 8 of 15 rows that report errors on invalid data, by 1.66× to 3.2×. If your hot path reports errors, ajv is the one to beat. Rejecting invalid input with a boolean check, ArkType was 1.31× ahead of typia.

// prefer no build step? dynamic ArkType runs the same definitions, as fast as precompiled on valid data in our runs of schemabenchmarks.dev's benchmark

27×smaller than Zod 4, on Valibot's own login form

Ship the checks, not the parser.

Valibot's own login form, messages included: 0.92 kB gzipped. Valibot ships 1.56. Zod ships 25.1.

  1. ArkType0.92 kBprecompiled · down from 98.1 kB with parser
  2. Valibot1.56 kB
  3. Zod Mini5.12 kB
  4. Zod25.1 kB
one block ≈ 250 B gzipped · the form from valibot.dev's comparison
as your app grows →how we measured →

Build the fastest validator or the smallest from the same definitions.

Big frontend? The "smallest" preset gzips smaller than Valibot at every scale we measured, 10 to 1,000 Types.

gzipped production bundledefault"smallest"Valibot
our startup benchmark's login app, 1 Type1.2 kB1.0 kB1.7 kB
its shop app, 23 Types5.1 kB3.5 kB3.6 kB
10 Types4.1 kB3.2 kB3.4 kB
50 Types11.5 kB5.4 kB5.5 kB
200 Types33.7 kB11.0 kB11.3 kB
1,000 Types139 kB37.2 kB39.5 kB

// these are other apps than Valibot's login form above, and their schemas have no custom messages or narrows; these results don't carry over to apps of forms, which we measured separately

In our runs of moltar's benchmark, counting instructions per call, "smallest" is 4% slower than Valibot on parseSafe and 2.1-2.6x faster on the other three cases, while Zod 4 is 1.5-7.9x faster than it and the default build 13-46x faster. The options

63×fewer startup instructions than Zod 4, on a login app

Nothing to parse at startup.

A precompiled Type costs nothing to create: it was built when you built. On the same app, that's 70% fewer startup instructions than Valibot.

$ node login-app.jsCPU instructions run
  1. ArkType✓ first validation0.69M
  2. ajv2.7× the instructions1.87M
  3. Valibot3.4× the instructions2.35M
  4. Zod Mini16× the instructions11.41M
  5. Zod63× the instructions43.72M
  6. Zod (compiled)74× the instructions51.55M
  7. TypeBox127× the instructions87.94M
CPU instructions from import through the first validation, lower is better · where ArkType finished · the homepage's login app

Compiling Zod costs it startup. Zod (compiled) ran 51.55M instructions to Zod's 43.72M.

03// @ark/aot

Your type in. Plain JavaScript out.

One plugin from @ark/aot. No parser, no new Function. Your definitions don't change.

vite.config.tsimport { precompile } from "@ark/aot/unplugin"
plugins: [precompile.vite()]
1write a Typeschema.ts
const 
const Shape: Type<{
    kind: "circle";
    radius: number;
} | {
    kind: "square";
    side: number;
}>
Shape
= type({
kind: "'circle'", radius: "number > 0" }).or({ kind: "'square'", side: "number > 0" })
the real precompiler runs in this tab
2what shipsas emitted · names shortened
const check1 = function (data, ctx) {	switch(data?.kind) {		case "circle": return check2(data)		case "square": return check3(data)	}	return false}
3 helpers
const check2 = function (data, ctx) {	for (;;) {		if (!((check4(data.radius)))) {			break		}		return true	}	return false}
const check3 = function (data, ctx) {	for (;;) {		if (!((check4(data.side)))) {			break		}		return true	}	return false}
const check4 = function (data, ctx) {	return (Number.isFinite(data)) && (data > 0)}
7 lines + 3 helpers · no parser, no new Functionerror path and wiring not shown
src/limits.ts
import { type } from "arktype"

const max = Number(process.env.MAX_NAME)

export const Name = type(`string <= ${max}`)

Same results. Same messages.

A precompiled validator accepts and rejects what the Type it replaces does, with the same error messages. If @ark/aot can't precompile a definition, the build stops and says what to change:

src/limits.ts:5:21  type(`string <= ${max}`) cannot be precompiled`max` is `Number(process.env.MAX_NAME)` (src/limits.ts:3:7)`process` is a global the build does not readReplace `process.env.MAX_NAME` with a value the build can read, like a literal or a const holding one, or put // @ark-runtime on the line before the definition, so arktype defines it at runtime.
the build's own error · your agent fixes it from the message alone

A build takes longer: precompiling moves creating your Types from your program's startup to your build.

We timed an app of 1012 Types: 22 copies of our startup benchmark's SaaS schemas, each Type validating a request in a handler. Each figure is a median, with the plugin rather than without it, on Node 25 with 16 cores.

  • A cold production build took 7.3 s rather than 414 ms with Vite 8, 8.2 s rather than 138 ms with esbuild and 20.3 s rather than 5.6 s with Next 16 on Turbopack.
  • At 92 Types, the plugin added 1.0 s to Vite's production build, 1.3 s to esbuild's and 2.5 s to Next's, and 256 ms to an edit in Vite's dev server.

Dev servers and watch mode

A precompiled validator doesn't compose or introspect at runtime.

It validates, asserts and implements Standard Schema as the Type it replaces does, and lacks methods like .and and .extends. The build fails wherever it sees your program rely on what a validator lacks. If you need the whole Type API at runtime, build with runtime: "arktype". Dynamic vs precompiled

04// migrate

Migrate your schemas with one prompt.

Paste once into Claude Code, Codex or Cursor. It installs the skill, converts your schemas, checks types and tests, and wires up @ark/aot.

Paste into your agent
or install the skill directly
order.ts·same file, converted
import { z } from "zod"

const 
const Item: z.ZodObject<{
    sku: z.ZodString;
    quantity: z.ZodNumber;
}, z.core.$strip>
Item
= z.object({
sku: z.string().min(1).max(32), quantity: z.number().int().min(1).max(99) }) const
const Order: z.ZodObject<{
    status: z.ZodEnum<{
        pending: "pending";
        paid: "paid";
        shipped: "shipped";
    }>;
    items: z.ZodArray<z.ZodObject<{
        sku: z.ZodString;
        quantity: z.ZodNumber;
    }, z.core.$strip>>;
    coupon: z.ZodNullable<z.ZodString>;
    total: z.ZodNumber;
}, z.core.$strip>
Order
= z.object({
status: z.enum(["pending", "paid", "shipped"]), items: z.array(
const Item: z.ZodObject<{
    sku: z.ZodString;
    quantity: z.ZodNumber;
}, z.core.$strip>
Item
).min(1),
coupon: z.string().length(8).nullable(), total: z.number().positive() }) type
type Order = {
    status: "pending" | "paid" | "shipped";
    items: {
        sku: string;
        quantity: number;
    }[];
    coupon: string | null;
    total: number;
}
Order
= z.infer<typeof
const Order: z.ZodObject<{
    status: z.ZodEnum<{
        pending: "pending";
        paid: "paid";
        shipped: "shipped";
    }>;
    items: z.ZodArray<z.ZodObject<{
        sku: z.ZodString;
        quantity: z.ZodNumber;
    }, z.core.$strip>>;
    coupon: z.ZodNullable<z.ZodString>;
    total: z.ZodNumber;
}, z.core.$strip>
Order
>
import { type } from "arktype"

const 
const Item: Type<{
    sku: string;
    quantity: number;
}>
Item
= type({
sku: "1 <= string <= 32", quantity: "1 <= number.integer <= 99" }) const
const Order: Type<{
    status: "pending" | "paid" | "shipped";
    items: {
        sku: string;
        quantity: number;
    }[];
    coupon: string | null;
    total: number;
}>
Order
= type({
status: "'pending' | 'paid' | 'shipped'", items:
const Item: Type<{
    sku: string;
    quantity: number;
}>
Item
.array().atLeastLength(1),
coupon: "string == 8 | null", total: "number > 0" }) type
type Order = {
    status: "pending" | "paid" | "shipped";
    items: {
        sku: string;
        quantity: number;
    }[];
    coupon: string | null;
    total: number;
}
Order
= typeof
const Order: Type<{
    status: "pending" | "paid" | "shipped";
    items: {
        sku: string;
        quantity: number;
    }[];
    coupon: string | null;
    total: number;
}>
Order
.infer

Messages you wrote and the libraries that read your schemas carry over. Async refinements and Zod's default error text don't.

What you keep

a message you wrote
shown as written, without its path, as Zod's issue.message was
tRPC, TanStack Form, react-hook-form
take the Type through Standard Schema, and read the same path and message
schemas you haven't converted
a Zod schema works inside an ArkType definition

What it costs

an async .refine()
runs after validation: ArkType is synchronous
Zod's default messages
ArkType's, like must be an email address