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

# Bytes.toString

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

Decodes a [`Bytes.Bytes`](/docs/utilities/bytes/types#bytes) into a string.

## Imports

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

## Examples

```ts twoslash
// @noErrors
import { Bytes } from 'viem/utils'

const data = Bytes.toString(
  Bytes.from([
    72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33
  ])
)
// @log: 'Hello world'
```

## Definition

```ts
function toString(
  bytes: Bytes,
  options?: toString.Options,
): string
```

## Parameters

### bytes

* **Type:** `Bytes`

The [`Bytes.Bytes`](/docs/utilities/bytes/types#bytes) to decode.

### options

* **Type:** `toString.Options`
* **Optional**

Options.

#### options.size

* **Type:** `number`
* **Optional**

Size of the bytes.

## Return Type

Decoded string.

`string`
