Skip to content
masterclass Buddy

Zod · Method

.base64

z.base64() creates a Zod schema for validating base64 strings. When converted to JSON Schema, it becomes a string with contentEncoding: "base64".

Last updated

Since
Zod 4

Syntax

z.base64()

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • z.base64url()
  • z.toJSONSchema()
  • contentEncoding
  • z.string()

Source: JSON Schema | Zod. Checked 2026-11-03.