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

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

Retrieves the size of a [`Hex.Hex`](/docs/utilities/hex/types#hex) value (in bytes).

## Imports

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

## Examples

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

Hex.size('0xdeadbeef')
// @log: 4
```

## Definition

```ts
function size(
  value: Hex,
): number
```

## Parameters

### value

* **Type:** `Hex`

The [`Hex.Hex`](/docs/utilities/hex/types#hex) value to get the size of.

## Return Type

The size of the [`Hex.Hex`](/docs/utilities/hex/types#hex) value (in bytes).

`number`
