Zod
TypeScript-first schema validation library. One schema = runtime validation + inferred TypeScript type. ~43.4k GitHub stars, ~129M npm weekly downloads. Zod 4 stable: 14x faster than v3, native JSON Schema, Zod Mini (~1.9KB gzip).
Strengths
- One schema = one validation + one TypeScript type, zero duplication, zero drift
- safeParse() returns a discriminated union, no try/catch for validation
- Zod 4: 14x faster string parsing, native JSON Schema with .toJSONSchema()
- Dominant ecosystem: tRPC, Drizzle, React Hook Form, Vercel AI SDK, Prisma
Limitations
- Bundle ~5-6KB gzip (core), Valibot lighter (~1.4KB per schema, tree-shakable)
- Raw performance lower than ArkType (3-100x faster, native TypeScript syntax)
Best for
- Data validation at system boundaries: APIs, forms, configs, env vars
- Shared schemas between frontend and backend (monorepo, tRPC)
- AI projects using structured output (Vercel AI SDK, OpenAI function calling)