# Hex.padLeft

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

## Imports

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

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

## Examples

```ts twoslash
import { Hex } from 'ox'

Hex.padLeft('0x1234', 4)
// @log: '0x00001234'
```

## Definition

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

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

## Parameters

### value

* **Type:** `Hex`

The [`Hex.Hex`](/api/Hex/types#hex) value to pad.

### size

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

The size (in bytes) of the output hex value.

## Return Type

The padded [`Hex.Hex`](/api/Hex/types#hex) value.

`padLeft.ReturnType`
