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

# UNBASE64

> Decodes MIME Base64 text.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Scalar function</span></div>

**Aliases:** [`from_base64`](/query/sql/functions/string/from_base64)

Returns NULL for NULL input.

## Syntax

### Scalar

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
unbase64(value)
```

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | STRING | Yes | Input value. |

## Returns

* Type: BINARY
* Possible values: Decoded bytes.
* NULL behavior: Returns NULL for NULL input.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Supports window usage | No |
| Exact result | Yes |

## Usage notes

* Encoding inserts a CRLF line break every 76 characters. Decoding removes CR and LF characters.

## Examples

### Typical behavior

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT hex(unbase64('YWJj')) AS "value";
```

| value |
| - |
| 616263 |

### Decode zero and high-byte values

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT hex(unbase64('AP8=')) AS decoded_hex;
```

| decoded\_hex |
| - |
| 00FF |

## Limitations

* Invalid Base64 raises an error.
* Padding and line-break handling can differ for some STRING column representations. Do not rely on identical padding or CR/LF formatting across all input sources.
* FROM\_BASE64 and UNBASE64 return BINARY. Query tools may report STRING instead; the returned bytes are not converted to text.


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