Primitive Types in Zod

From the Zod cheat sheet ยท Primitive Schemas ยท verified Jul 2026

Primitive Types

Schemas for strings, numbers, booleans, dates, and special types

typescript
import * as z from "zod";

z.string();
z.number();
z.boolean();
z.date();
z.bigint();
z.symbol();

z.null();
z.undefined();
z.any();
z.unknown();
z.never();
๐Ÿ’ก Zod schemas are immutable โ€” methods return new schemas instead of mutating
โšก Use z.unknown() instead of z.any() to keep type safety throughout your code
๐Ÿ“Œ z.literal() matches an exact value โ€” useful for tagged unions and constants
๐ŸŸข z.date() validates Date objects, not date strings โ€” use z.coerce.date() for strings
primitivestypes
Back to the full Zod cheat sheet