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

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

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

## Imports

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

## Examples

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

Bytes.toBoolean(Bytes.from([1]))
// @log: true
```

## Definition

```ts
function toBoolean(
  bytes: Bytes,
  options?: toBoolean.Options,
): boolean
```

## Parameters

### bytes

* **Type:** `Bytes`

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

### options

* **Type:** `toBoolean.Options`
* **Optional**

Decoding options.

#### options.size

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

Size of the bytes.

## Return Type

Decoded boolean.

`boolean`
