Skip to content

base64

Validates that a field contains a valid Base64 encoded string.

Options

OptionTypeDefaultDescription
messagestringlocale defaultCustom error message

Playground

Valid values

ValueNotes
"SGVsbG8=""Hello" in Base64
"dGVzdA==""test" in Base64

Invalid values

ValueReason
"Hello!"Contains ! which is not a Base64 character
"SGVsbG8"Missing required padding (=)

Notes

  • Empty string ("") always returns valid: true. Combine with notEmpty to require a value.

Released under the MIT License.