> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# from_base64

> Decodes a Base64-encoded string.

Decodes a Base64-encoded string. This function is an inverse of [to\_base64](/documents/4.2/sql-reference/sql-functions/crytographic-functions/to_base64.md).

## Syntax

```Haskell theme={null}
from_base64(str);
```

## Parameters

`str`: the string to decode. It must be of the VARCHAR type.

## Return value

Returns a value of the VARCHAR type. If the input is NULL or an invalid Base64 string, NULL is returned. If the input is empty, an error is returned.

This function accepts only one string. More than one input string causes an error.

## Examples

```Plain Text theme={null}
mysql> select from_base64("starrocks");
+--------------------------+
| from_base64('starrocks') |
+--------------------------+
| ²֫®$                       |
+--------------------------+
1 row in set (0.00 sec)

mysql> select from_base64('c3RhcnJvY2tz');
+-----------------------------+
| from_base64('c3RhcnJvY2tz') |
+-----------------------------+
| starrocks                   |
+-----------------------------+
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.