# Bytes.toBigInt

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

## Imports

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

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

## Examples

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

Bytes.toBigInt(Bytes.from([1, 164]))
// @log: 420n
```

## Definition

```ts
function toBigInt(
  bytes: Bytes,
  options?: toBigInt.Options,
): bigint
```

**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:** `toBigInt.Options`
* **Optional**

Decoding options.

#### options.signed

* **Type:** `boolean`
* **Optional**

Whether or not the number of a signed representation.

#### options.size

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

Size of the bytes.

## Return Type

Decoded bigint.

`bigint`
