---
title: "Binary string functions"
description: "Scalar functions for manipulating binary strings"
---

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

# Binary string functions

_Arroyo's Scalar function implementations are based on
[Apache DataFusion](https://arrow.apache.org/datafusion/) and these docs are derived from
the DataFusion function reference._

## `encode`

Encode binary data into a textual representation.

```
encode(expression, format)
```

**Arguments**

- **expression**: Expression containing string or binary data

- **format**: Supported formats are: `base64`, `hex`

**Related functions**:
[decode](#decode)

## `decode`

Decode binary data from textual representation in string.

```
decode(expression, format)
```

**Arguments**

- **expression**: Expression containing encoded string data

- **format**: Same arguments as [encode](#encode)

**Related functions**:
[encode](#encode)

Source: https://www.arroyo.dev/docs/sql/scalar-functions/binary-string/index.mdx
