---
title: "BASE64_DECODE"
description: "The BASE64_DECODE SQL function converts a base64 encoded value back to the binary object as defined in RFC 4648."
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/base64-decode
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/base64-decode
updated: 2026-10-22T00:00:00Z
license: https://documentation.invantive.eu/en/
---

## Syntax
```mermaid
%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> BASE64_DECODE[BASE64_DECODE]:::quoted
    BASE64_DECODE --> End((END))
```

## Purpose
The `BASE64_DECODE` SQL function converts a base64 encoded value back to the binary object as defined in [RFC 4648](https://www.rfc-editor.org/rfc/rfc4648). 

See also [[BASE64_ENCODE]].

Parameters:
- Input (`varchar2`): value to convert back to the original.

Returns: the input decoded back to the binary value as `blob`.

## Examples
`BASE64_DECODE` maps the text `aGk=` to a binary object and then to a text in 7-bit ASCII character set:
```sql
select blob_to_text(base64_decode('aGk='), 'ASCII')

--------
hi
```
`BASE64_DECODE` maps a base64 encoded text to a binary object and then to a text using `TO_CHAR`:
```sql
select to_char(base64_decode('VGhpcyBpcyBhIGJhc2U2NCB0ZXN0'))

----------------------
This is a base64 test
```