Runtime verified Test scripts included

Turns readable text into a Base64 string.

Syntax

{{base64Encode text [...options]}}

Returns string.

Parameters

Name Type Required Description
text string Yes The text to encode.
options any No, repeatable Named argument characterEncoding: ASCII, UTF-7, UTF-8, UTF-16 or UTF-32.

Example

Tested in a Marketing Cloud Next email on 2026-11-22:

  • {{base64Encode "abc"}} renders YWJj, as documented.
  • {{base64Encode "abc" characterEncoding="UTF-16"}} renders YQBiAGMA.
Show Next test script
<!-- Marketing Cloud Next test script for the base64Encode helper. Paste it into the HTML component of a
     Next email and open the preview. Each line prints the result Next gave when the call
     was rendered on its own (expect) next to the result of this run (got).
     Assembled from single-call test emails (dates on the page); it has not been
     run as one email. Calls that make Next fail are listed separately. -->
<p>c1 expect=[YWJj] got=[{{base64Encode "abc"}}]</p>
<p>c2 expect=[YQBiAGMA] got=[{{base64Encode "abc" characterEncoding="UTF-16"}}]</p>

Marketing Cloud Next

Works as documented

Every tested call rendered the documented result. Tested 2026-11-22 by rendering in a Marketing Cloud Next email.

See also