> **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.toHex

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

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

## Imports

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

## Examples

```ts twoslash
// @noErrors
import { Rlp } from 'viem/utils'
Rlp.toHex('0x8b68656c6c6f20776f726c64')
// 0x68656c6c6f20776f726c64
```

## Definition

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

## Parameters

### value

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

The value to decode.

## Return Type

The decoded [`Hex.Hex`](/docs/utilities/hex/types#hex) value.

`RecursiveArray<Hex.Hex>`
