# Zod

MIT\-licensed JavaScript and TypeScript schema\-validation library with runtime parsing and static type inference\.

ID: Q54 · Revision: 38

Type: software · License: MIT[^license] · Status: active

Website: https://zod.dev/



Zod is an open\-source schema\-validation library that checks data at runtime and infers TypeScript types from the same schema definitions\. It can be used for structured inputs such as API payloads, forms and configuration\. In AI\-assisted development, a schema makes some expectations executable, but passing a shape check does not establish that the data is truthful, authorized or correct for the application's business rules\.[^intro][^basics][^api]

## Capabilities and substitutions

### Runtime parsing and inferred types — supported

Schema parsing validates unknown input and returns the parsed result; inferred input/output types may differ after transformations\.[^basics]

Use case: Runtime validation of application inputs and data boundaries · Platforms: Node\.js, Modern web browsers, JavaScript, TypeScript · Region: Version, build and integration requirements apply

### Object\-key policy — supported

Default objects strip extra keys; strict and loose schemas explicitly reject or preserve them\.[^api]

Use case: Runtime validation of application inputs and data boundaries · Platforms: Node\.js, Modern web browsers, JavaScript, TypeScript · Region: Version, build and integration requirements apply

### Lossless JSON Schema conversion — limited

Some Zod types and transformations cannot be represented; permissive fallback can discard constraints and import remains experimental\.[^json]

Use case: Runtime validation of application inputs and data boundaries · Platforms: Node\.js, Modern web browsers, JavaScript, TypeScript · Region: Version, build and integration requirements apply

### Bundle\-oriented functional variant — supported

Zod Mini exposes functional APIs designed for tree shaking; actual savings depend on the schemas and build\.[^mini]

Use case: Runtime validation of application inputs and data boundaries · Platforms: Node\.js, Modern web browsers, JavaScript, TypeScript · Region: Version, build and integration requirements apply

### [Substitute for Valibot](/valibot) — limited

Can substitute for runtime data validation and inferred TypeScript schemas, with a different API and error/output handling\. Existing pipelines need translation and behavioral tests\.[^intro][^basics][^valibot]

Use case: Runtime validation of application inputs and data boundaries · Platforms: Node\.js, Modern web browsers, JavaScript, TypeScript · Region: Version, build and integration requirements apply

## References

[^intro]: [Zod introduction](<https://zod.dev/>) — Runtime schema validation, TypeScript requirements and JavaScript support (vendor; retrieved 2026-10-07T22:48:59Z)

[^license]: [Zod license](<https://github.com/colinhacks/zod/blob/main/LICENSE>) — MIT license (vendor; retrieved 2026-10-07T22:49:54Z)

[^basics]: [Zod basic usage](<https://zod.dev/basics>) — parse/safeParse, async variants and distinct input/output types (vendor; retrieved 2026-10-07T22:49:54Z)

[^api]: [Zod schema API](<https://zod.dev/api>) — Object unknown\-key policy, strict/loose objects and coercion (vendor; retrieved 2026-10-07T22:50:17Z)

[^json]: [Zod JSON Schema conversion](<https://zod.dev/json-schema>) — Unrepresentable types, input/output conversion and experimental import (vendor; retrieved 2026-10-07T22:49:13Z)

[^mini]: [Zod Mini](<https://zod.dev/packages/mini>) — Functional tree\-shakable API and workload\-specific bundle comparison (vendor; retrieved 2026-10-07T22:49:13Z)

[^migration]: [Zod 4 migration guide](<https://zod.dev/v4/changelog>) — Error API changes and defaults inside optional fields (vendor; retrieved 2026-10-07T22:50:17Z)

[^valibot]: [Valibot introduction](<https://valibot.dev/guides/introduction/>) — Modular schema/validation functions and runtime validation (vendor; retrieved 2026-10-07T22:48:59Z)

Source revision: https://substitutefor.net/entities/Q54?revision=38
