# BASE64\_DECODE

**The function BASE64\_DECODE decodes** [**Text**](../../variable-data-types/the-text-variable-data-type) **that has been encoded using** [**base64 encoding**](https://en.wikipedia.org/wiki/Base64)**.**

This function accepts a String holding base64 encoded data and returns the decoded text of that data. Note that while base64 encoding can encode any arbitrary data, BASE64\_DECODE only decodes plain text that was encoded. See [Encoding in Airscript (URLs & Base64)](../../airscript/working-with-urls-and-base64) for more details.

#### Declaration

```javascript
BASE64_DECODE(base64_data) -> decoded_string
```

#### Parameters

**base64\_data** (required, type: _string_) A string containing base64 encoded data.

#### Return Values

**decoded\_string** (type: _string_) The decoded string.

#### Examples

The base64 encoding for the string **"top secret!"** is **"dG9wIHNlY3JldCE="**. This string can be decoded with BASE64\_DECODE, making it not so top secret.

```javascript
BASE64_DECODE("dG9wIHNlY3JldCE=") -> "top secret!"
```

#### Discussion

The function [BASE64\_ENCODE](base64_encode) is the opposite operation to BASE64\_DECODE. Rather than decoding a String, it will encode it. Encoding, and then decoding a String will produce the original String.

```javascript
BASE64_DECODE(BASE64_ENCODE("Hello, world!")) -> "Hello, world"
```
