ShopperCove
Menu
All writingBlogTopicsCategoriesAboutRSS
Blog
Categories
Observability & SRE62All categories
Topics
sre111localhost lab102performance70python58javascript47bundle size36benchmarking35node.js35web development21typescript19benchmark16content creation15All topics
About
Loading article…

ShopperCove

Hands-on notes on developer tools, written after the tool has actually been run.

All writingBlogCategoriesTopicsAboutPrivacyRSS

© 2026 ShopperCove

On this page

  1. What I tested
  2. How wide was the parse gap?
  3. Does the bundle gap change the call?
  4. Should you switch schema libraries?
  5. FAQ
  6. Is Valibot faster than Zod?
  7. How much smaller is Valibot than Zod?
  8. Should I switch from Zod to Valibot?
  9. Sources
  10. Related
  1. Blog

Valibot vs Zod: Which Is Faster? 0.97M vs 1.14M Parses

zod 4.6.5 vs valibot 1.5.0 on one nested user schema (uuid/email/age/tags/profile/enum). Warm medians after 2k warmup + 9×50k: zod.parse 1,144,494 ops/s vs valibot.parse 968,187 (~1.18×). safeParse fail: valibot 697,760 vs zod 415,523 (~1.7×). esbuild minify+gzip9: 452,999/92,636 B vs 85,126/15,422 B. Package trees ~6.1 MB vs ~1.9 MB. Fixture /workspace/bench-zod-valibot/.

5 October 2026·4 min read

Hands-on

Disclosure

This post contains affiliate links. If you buy through them, I may earn a commission at no extra cost to you. I only make firsthand claims about products I have actually used.

On this page
  1. What I tested
  2. How wide was the parse gap?
  3. Does the bundle gap change the call?
  4. Should you switch schema libraries?
  5. FAQ
  6. Is Valibot faster than Zod?
  7. How much smaller is Valibot than Zod?
  8. Should I switch from Zod to Valibot?
  9. Sources
  10. Related

In a Valibot vs Zod test on one nested user schema, Zod 4.6.5 parsed valid input faster (1.14M vs 0.97M ops/s median, about 1.18x), while Valibot 1.5.0 was about 1.7x faster on invalid input (697,760 vs 415,523 ops/s). Valibot's bundle was far smaller at 15 KB vs 93 KB gzipped, so stay on Zod 4 for server-side APIs that already use it, and pick Valibot when client bundle size is the constraint.

What I tested

  • Machine: 8 vCPU Intel Xeon / 15 GB RAM shared Linux cloud box, tested 6 Oct 2026 about 00:30–00:35 IST.
  • Versions: zod 4.6.5, valibot 1.5.0, Node 22.20.0, esbuild for the bundle check.
  • Fixture: /workspace/bench-zod-valibot/. One object schema (uuid, email, int age, tags array, nested profile, enum role). Good payload and a bad payload (bad email, negative age, invalid role).
  • Timing: 2,000 warm iterations, then 9 rounds of 50,000 parse/safeParse calls each. Medians reported. Bundle: esbuild minify ESM browser build of export { z } from "zod" vs export * as v from "valibot", gzip -9.
  • Findings: zod.parse ok 1,144,494 ops/s (median 43.7 ms / 50k); valibot.parse ok 968,187 ops/s (51.6 ms). zod.safeParse ok 1,139,141; valibot.safeParse ok 979,417. On failures: valibot.safeParse 697,760 ops/s vs zod.safeParse 415,523 (~1.7× for Valibot). Package trees on disk: zod ~6.1 MB, valibot ~1.9 MB. Minify 452,999 B vs 85,126 B; gzip 92,636 B vs 15,422 B.
  • One surprise: Zod 4 beat Valibot on the success path for this schema; Valibot still dominated fail-path throughput and the shipped bundle.
  • Not tested: Zod codecs/transforms beyond this object, Valibot async pipes, TypeScript compile time, Deno/Bun, edge runtimes, schema codegen, Ajv.

How wide was the parse gap?

PathMedian ops/sMedian ms / 50k
zod.parse ok1,144,49443.7
valibot.parse ok968,18751.6
zod.safeParse ok1,139,14143.9
valibot.safeParse ok979,41751.1
zod.safeParse fail415,523120.3
valibot.safeParse fail697,76071.7

Same schema shape, same box. Happy-path parse favored Zod 4 here; invalid input favored Valibot. For lint/format cousins see Biome vs ESLint/Prettier and oxlint vs ESLint. For shipped JS weight, pair with size-limit vs bundlesize.

Does the bundle gap change the call?

Yes, if the schema library lands in the browser. Minified ESM was 453 KB for Zod vs 85 KB for Valibot; gzip -9 was 93 KB vs 15 KB (~6×). Installed package trees were ~6.1 MB vs ~1.9 MB. Server-only validation can ignore that; a form-heavy SPA should not.

Treat this as one object schema on Node 22, not a claim that Zod is always faster. Fail-path and bundle still lean Valibot.

Should you switch schema libraries?

SituationMy pick
Already on Zod 4 in a Node APIStay on Zod
Browser bundle is tightValibot
Heavy invalid-input trafficValibot (faster fail path here)
Need the Zod ecosystem (resolvers, partners)Zod
Auditing unused deps after a swapPair with knip vs depcheck​
Comparing test runners beside schema testsSee Jest vs Vitest​

Bottom line: on 50k parses of one user object, Zod 4.6.5 hit 1.14M ops/s median while Valibot 1.5.0 hit 0.97M, but Valibot shipped a 15 KB gzip bundle against Zod’s 93 KB. Who should not switch: teams whose Zod schemas and partner libs already pass CI.

How this was made: I installed zod and valibot on the ShopperCove box, timed interleaved parse rounds after a warm-up, measured esbuild minify+gzip sizes, recorded JSON; the write-up was drafted with AI help and checked against that output.

FAQ

Is Valibot faster than Zod?

Not on the success path in this test: Zod 4.6.5 hit 1,144,494 ops/s vs Valibot 1.5.0 at 968,187. On failing input Valibot's safeParse was faster, 697,760 vs 415,523 ops/s.

How much smaller is Valibot than Zod?

Minified ESM was 453 KB for Zod vs 85 KB for Valibot, and gzip -9 was 93 KB vs 15 KB (about 6x). Installed package trees were about 6.1 MB vs 1.9 MB.

Should I switch from Zod to Valibot?

Only if the schema library ships to the browser and bundle size matters, or you handle a lot of invalid input. A Node API already on Zod 4 has little reason to switch.

Sources

  • 01zod.devhttps://zod.dev/
  • 02npmjs.com/package/zod
  • 03valibot.devhttps://valibot.dev/
  • 04npmjs.com/package/valibot
  • 05github.com/colinhacks/zod
  • 06github.com/fabian-hiller/valibot

Related

  • 01shoppercove.com/blog/dprint-vs-prettier
  • 02shoppercove.com/blog/bun-test-vs-vitest
  • 03shoppercove.com/blog/esbuild-register-vs-jiti
zodvalibotbenchmarkingperformanceschema validationbundle sizejavascript

Lab evidence

What I found running this

Hands-on on ShopperCove box 6 Oct 2026 ~00:30–00:35 IST (8 vCPU Intel Xeon / 15 GB shared Linux, Node 22.20.0). zod 4.6.5 vs valibot 1.5.0. Fixture /workspace/bench-zod-valibot/: one object schema (uuid, email, int age 0–120, tags[], nested profile, enum role); good + bad payloads. 2,000 warm iterations then 9 rounds × 50,000. Medians: zod.parse ok 1,144,494 ops/s (43.7 ms/50k); valibot.parse ok 968,187 (51.6 ms); zod.safeParse ok 1,139,141; valibot.safeParse ok 979,417; zod.safeParse fail 415,523; valibot.safeParse fail 697,760. Disk trees ~6.1 MB zod vs ~1.9 MB valibot. esbuild minify ESM: 452,999 B vs 85,126 B; gzip -9 92,636 B vs 15,422 B. Raw: /workspace/bench-zod-valibot/res-zod-valibot.json + res-bundle.json. Not tested: Ajv, async pipes, TS compile time, Deno/Bun, edge, schema codegen. No affiliate.

Explore the product

Untested by us. Check what's included, the license and refund terms before you buy.

Ready Client Sites for prebuilt websites

See Ready Client Sites details

AI Traffic Secrets for AI-era SEO

See AI Traffic Secrets details

Notes when a lab post goes up

Occasional email for new hands-on reviews. No sequence and no sponsors.

Explore the product

Untested by us. Check what's included, the license and refund terms before you buy.

Ready Client Sites for prebuilt websites

See Ready Client Sites details

AI Traffic Secrets for AI-era SEO

See AI Traffic Secrets details

Keep reading

  • ofetch vs ky: 4.1 KB vs 9.8 KB Gzip

    Hands-on6 Oct 20264 min read

  • ohash vs object-hash: 10x Faster, 3.3 KB vs 11 KB

    Hands-on6 Oct 20265 min read

  • Klona vs structuredClone: 1.4M vs 225k Clones per Second

    Hands-on6 Oct 20265 min read