# `DECODE`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Decodes binary data from a textual representation.

## Syntax

```sql
decode(<string>, <format>)
```

## Arguments

### Required

- `<string>`: The encoded string to decode.
- `<format>`: The encoding format of the string (`base64`, `hex`, or `escape`).

## Returns

Returns bytea (binary data) decoded from the textual representation.

## Examples

### Decode Base64

Decode a base64-encoded string.

```sql
SELECT decode('MTIzXDAwMFwwMDE=', 'base64') AS result;
```

Returns `123\000\001`.

## Related Documentation

- [String Types](/docs/data/data-cloud-query-guide/references/dc-sql-reference/string.md)
