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

# Hex.padRight

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

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

## Imports

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

## Examples

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

Hex.padRight('0x1234', 4)
// @log: '0x12340000'
```

## Definition

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

## Parameters

### value

* **Type:** `Hex`

The [`Hex.Hex`](/docs/utilities/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`](/docs/utilities/hex/types#hex) value.

`padRight.ReturnType`
