# Bytes.toBoolean

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

## Imports

:::code-group
```ts [Named]
import { Bytes } from 'ox'
```

```ts [Entrypoint]
import * as Bytes from 'ox/Bytes'
```
:::

## Examples

```ts
import { Bytes } from 'ox'

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

## Definition

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

**Source:** [src/core/Bytes.ts](https://github.com/wevm/ox/blob/main/src/core/Bytes.ts#L890)

## Parameters

### bytes

* **Type:** `Bytes`

The [`Bytes.Bytes`](/api/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`
