---
title: "base64Encode"
canonical: "https://support.appfire.com/space/PSCONF/15305494/base64Encode"
format: markdown
---
> Macro (aura-html)


 > Macro (button-handy)




> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | base64Encode(textToEncode) | **Package** |  |
> | **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Encodes text in Base64.

Encodes text in Base64. This is useful when transferring data like attaching a signature to the bottom of an email or storing images in a database. Returns the input text base64 encoded.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | textToEncode | String | Yes | Text to encode in Base64. |

## Return Type

**String**

## Example

```javascript
return base64Encode("Encode this text!");
```

Returns "RW5jb2RlIHRoaXMgdGV4dCE="

## See also

> Macro (contentbylabel)