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

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

Pads a [`Bytes.Bytes`](/docs/utilities/bytes/types#bytes) value to the left with zero bytes until it reaches the given `size` (default: 32 bytes).

## Imports

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

## Examples

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

Bytes.padLeft(Bytes.from([1]), 4)
// @log: Uint8Array([0, 0, 0, 1])
```

## Definition

```ts
function padLeft(
  value: Bytes,
  size?: number,
): padLeft.ReturnType
```

## Parameters

### value

* **Type:** `Bytes`

[`Bytes.Bytes`](/docs/utilities/bytes/types#bytes) value to pad.

### size

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

Size to pad the [`Bytes.Bytes`](/docs/utilities/bytes/types#bytes) value to.

## Return Type

Padded [`Bytes.Bytes`](/docs/utilities/bytes/types#bytes) value.

`padLeft.ReturnType`
