What this thread does
Do first: For a method-based validator, start with npm install zod@^4.0.0; Zod's own guidance prefers regular Zod unless bundle constraints justify Mini. Zod Mini
Short answer
Choose by the API you want to author, and use the shared interface when accepting schemas from callers:
| Need | Choice and documented distinction |
|---|---|
| Method-based schemas | Zod 4 is stable; its schemas validate data and infer TypeScript types. Zod |
| Modular functions | Valibot uses small independent functions so bundlers can remove unused code. Introduction |
| TypeScript-like schema definitions | ArkType defines schemas with TypeScript-style expressions and validates unknown input by calling the schema. Your First Type |
| Accept validators from different libraries | Standard Schema specifies a common interface implemented by schema libraries, with no runtime code in its types package. Specification |
What to do
| Library | Install and first API | Requirements from its docs |
|---|---|---|
| Zod 4 | npm install zod@^4.0.0; import from zod; construct with z.object and z.string, then call the schema's .parse(input). | TypeScript 5.5 or later is officially supported; enable strict: true in tsconfig.json. Intro, install version |
| Valibot | npm install valibot; import from valibot; compose with v.pipe, validate with v.parse, or use safeParse for a non-exception API. | Minimum TypeScript 5.0.2; strict: true in tsconfig.json is recommended. Distributed files target ES2020, so the bundler/transpiler must support it. Installation, APIs |
| ArkType | pnpm install arktype; import type from arktype; call the defined schema on input and detect errors with out instanceof type.errors. | TypeScript >=5.1; ESM imports or "type": "module" in package.json; strict or strictNullChecks required in tsconfig.json. skipLibCheck is strongly recommended and exactOptionalPropertyTypes recommended. Setup, validation |
For bundle-sensitive Zod code, import zod/mini: it provides the same functionality through a functional, tree-shakable API. The Zod docs recommend measuring your own bundle before choosing it. Zod Mini
For a library that accepts caller-provided validators, use StandardSchemaV1. The spec puts validation under ~standard, whose interface has version: 1. Its documented implementation floors are Zod 3.24.0+, Valibot 1.0+, and ArkType 2.0+. Standard Schema
The @standard-schema/spec package is optional: the spec permits copying its types. If using the package for a public library API, install it as a regular dependency and consume it with import type; the FAQ explicitly advises against a dev dependency. The validation entry point schema['~standard'].validate(data) can return a result or a Promise. Specification and FAQ
Limits and open questions
These are choices based on documented API and compatibility requirements, not a measured performance ranking. No application bundle, benchmark, or migration was run. Standard Schema's synchronous-validation FAQ warns that validation may return a Promise; callers requiring synchronous results must handle that case. FAQ
Not for: Ajv JSON Schema configuration or a Zod 3 migration walkthrough.
Sources
- Zod: introduction, stable version and requirements
- Zod: Mini API, installation and selection guidance
- Valibot: introduction and parsing APIs
- Valibot: installation and compiler requirements
- ArkType: setup
- ArkType: Your First Type
- Standard Schema: project overview
- Standard Schema: interface, compatibility list and FAQ
Checked
2026-11-17: read the eight official pages listed above; no command was run.
Started from a post by @colinhacks, packaged by the editor. Original post