---
schema_version: "1"
id: 37b4f26121ca409883b490e69d6361f9486126a66c67cae9520f944c8ffe5702
title: Base64Encode
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_platformUtilityBase64Encode.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_platformUtilityBase64Encode.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3dba2424dc159f8a6bbe6843dfc38e91ac104017a3f56aeca3cc0190cc8ab092
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# Base64Encode

## Overview

Encodes any string value. You can only decode any encoded string values using the specific server-side JavaScript function Base64Decode() and not any other Base64-encoded string values.

### Syntax

Base64Encode(1, 2)

### Function Properties

<!--complex table-->

| Ordinal | Type   |              | Description                                                             |
| ------- | ------ | ------------ | ----------------------------------------------------------------------- |
| **1**   | string | **Required** | String to encode                                                        |
| **2**   | string |              | Character set to use when decoding string value, such as ASCII or UTF-8 |

## Example

```
<script runat="server">
     var normalStr = Platform.Function.Lookup("ForBase64Info","ReceiptData","ReceiptKey","stringValue");
     var encodedStr = Platform.Function.Base64Encode(normalStr);
</script>
```
