---
schema_version: "1"
id: 0c8e9f8cc665bed58ab1ef1c31ca91a6e0c5f463276c5c10447c33df9849996b
title: "Handlebars Helper Function: base64Decode"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/handlebars/reference/utility/mcn-handlebars-reference-utility-base64decode.md
canonical_url: https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-utility-references/mcn-handlebars-reference-utility-base64decode.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 16d6b2a9abd2ae338e784b404ccbd489f98e916f8be976af203fc460e704fa37
products:
  - Handlebars for Marketing Cloud Next
  - Marketing Cloud
---
# Handlebars Helper Function: base64Decode

Converts Base64-encoded binary data to plain text.

## Availability

This helper is available in the Winter ’27 release of Marketing Cloud Next.

## Syntax

```handlebars
{{base64Decode stringToDecode
  characterEncoding="CHARSET" [abortSendOnFail=true|false]}}
```

## Parameters

| Parameter           | Type    | Description                                                                                                                             |
| ------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `stringToDecode`    | String  | Required. The Base64-encoded string to decode.                                                                                          |
| `characterEncoding` | String  | The character encoding to use. Specify as a named parameter with one of these values: `ASCII`, `UTF-7`, `UTF-8`, `UTF-16`, or `UTF-32`. |
| `abortSendOnFail`   | Boolean | Indicates whether to abort a send if `stringToDecode` can't be decoded. Specify as a named parameter.                                   |

## Return Value

The function returns the decoded plain-text value.

## Usage Example

This example decodes a Base64-encoded coupon code that was retrieved from a marketing object so that it can be displayed to a subscriber as plain text.

```handlebars
{{base64Decode "NmRuMjh1cXhvY3F1"}}
```

The function returns this decoded string:

```text
6dn28uqxocqu
```

### Handling Decoding Failures

This example decodes a value that isn't valid Base64 data, and sets the value of `abortSendOnFail` to `false` so that an email send continues even if decoding fails.

```handlebars
{{base64Decode invalidEncodedValue characterEncoding="UTF-8" abortSendOnFail=false}}
```

If `invalidEncodedValue` can't be decoded, the helper returns an empty string instead of stopping the send.
