> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# Rlp.toBytes

:::info
`Rlp.toBytes` is a re-export of ox's [`Rlp.toBytes`](https://oxlib.sh/api/Rlp/toBytes). Refer to the ox documentation for the full reference.
:::

Decodes a Recursive-Length Prefix (RLP) value into a [`Bytes.Bytes`](/docs/utilities/bytes/types#bytes) value.

## Imports

```ts
import { Rlp } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { Rlp } from 'viem/utils'
Rlp.toBytes('0x8b68656c6c6f20776f726c64')
// Uint8Array([139, 104, 101, 108, 108, 111,  32, 119, 111, 114, 108, 100])
```

## Definition

```ts
function toBytes(
  value: Bytes.Bytes | Hex.Hex,
): RecursiveArray<Bytes.Bytes>
```

## Parameters

### value

* **Type:** `Bytes.Bytes | Hex.Hex`

The value to decode.

## Return Type

The decoded [`Bytes.Bytes`](/docs/utilities/bytes/types#bytes) value.

`RecursiveArray<Bytes.Bytes>`
