Handlebars base64Encode
Handlebars base64Encode: turns readable text into a Base64 string.
Next
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"}}rendersYWJj, as documented.{{base64Encode "abc" characterEncoding="UTF-16"}}rendersYQBiAGMA.
Show Next test script
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
- AMPscript
Base64Encode— does a similar job in AMPscript, with a different call shape - Official reference