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

# Ens.labelhash

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

Hashes ENS label.

Since ENS labels prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS labels](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `labelhash`. You can use the built-in [`Ens.normalize`](/docs/utilities/ens/normalize) function for this.

## Imports

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

## Examples

```ts twoslash
// @noErrors
import { Ens } from 'viem/utils'
Ens.labelhash('eth')
;('0x4f5b812789fc606be1b3b16908db13fc7a9adf7ca72641f84d75b47069d3d7f0')
```

## Definition

```ts
function labelhash(
  label: string,
): `0x${string}`
```

## Parameters

### label

* **Type:** `string`

ENS label.

## Return Type

ENS labelhash.

`0x${string}`
