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

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

Hashes ENS name.

Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `namehash`. 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.namehash('wevm.eth')
// @log: '0xf246651c1b9a6b141d19c2604e9a58f567973833990f830d882534a747801359'
```

## Definition

```ts
function namehash(
  name: string,
): `0x${string}`
```

## Parameters

### name

* **Type:** `string`

ENS name.

## Return Type

ENS namehash.

`0x${string}`
