BASE64_DECODE()

All functions > STRING > BASE64_DECODE()

Decodes a Base64 string back to plain text.

Signatures

Returns: Decoded string

BASE64_DECODE(encoded: VARCHAR) → VARCHAR
sql
ParameterTypeRequiredDescription
encodedVARCHARYesBase64 text to decode

Notes

  • Expects standard Base64 (including padding where required); malformed input fails at run time
  • Interprets decoded bytes as text (invalid byte sequences fail at run time)
  • Returns NULL if the input is NULL (use NULL(VARCHAR); bare NULL fails inference)
  • Inverse of BASE64_ENCODE for valid round-trip payloads

See also

Examples

FeatureQL
SELECT
    f1 := BASE64_DECODE('aGVsbG8='), -- Decode ASCII payload
    f2 := BASE64_DECODE(''), -- Empty Base64 decodes to empty string
    f3 := BASE64_DECODE(NULL(VARCHAR)) -- NULL yields NULL
;
Result
f1 VARCHARf2 VARCHARf3 VARCHAR
hello(empty)NULL

Last update at: 2026/05/26 17:22:09