UtilityToolsLab

© 2026 UtilityToolsLab. Built and maintained by the UtilityToolsLab Team.

Free eBooks·About·Changelog·Privacy Policy·Terms of Service·Report a bug
HomeSmart Contracts & EVMENS Namehash

Related Tools

Function SelectorGas Fee CalculatorMerkle Tree BuilderABI Encoder

ENS Namehash Calculator

Compute the ENS namehash (EIP-137) for any .eth domain, label by label, using Keccak-256 in your browser. See every recursive hashing step.

You Might Also Like

All Smart Contracts & EVM

Function Selector

Compute the 4-byte Ethereum function selector from a Solidity signature using Keccak-256, entirely in your browser. Paste names or types.

Gas Fee Calculator

Calculate Ethereum gas fees in ETH and USD. Supports EIP-1559 (base fee + tip) and legacy gas price. Six transaction type presets included.

Merkle Tree Builder

Build a Keccak-256 Merkle tree from an address allowlist, read off the root, and copy an inclusion proof for any leaf. OpenZeppelin sorted pairs.

ABI Encoder

Encode a Solidity function call to calldata or decode raw calldata to typed values. Supports uint/int, bool, address, bytesN, bytes and string. No upload.

ENS doesn’t look up vault.finance.eth as a string anywhere on-chain. Every name a resolver contract stores is first collapsed into a single 32-byte value called its node, and that collapse is the namehash algorithm from EIP-137. It isn’t one hash of the whole string. It processes labels right to left, folding each one into the last result, which is why finance.eth and vault.finance.eth share no structure in their output even though one contains the other.

This tool runs that recursion client-side and shows every intermediate node, not just the final one, because the right-to-left order is the detail people get backwards when computing it by hand or copying pseudocode without checking the loop direction.

Worked Example: A Two-Label Subdomain

Click Load Sample and the input fills with vault.finance.eth. The tool splits it into eth, finance and vault, processes them in that order starting from the 32-byte zero node, and the breakdown panel shows each label’s own Keccak-256 hash alongside the running node after it’s folded in. The node after eth is 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae, the same value every .eth name shares as its parent, and the final namehash, after vault is folded in last, is 0x012f568ae19a292705aff770afd1bb534a4565ec446c2602bc314221616137df.

The Algorithm, Written Out

Start with node = 0x00…00 (32 zero bytes). For each label from the rightmost (the TLD) to the leftmost (the subdomain), compute node = keccak256(node + keccak256(label)), where + means byte concatenation, not addition: 32 bytes of the running node followed by 32 bytes of the label’s own hash, hashed together as one 64-byte input. Run out of labels and the last node produced is the namehash. This implementation was checked during development against independently computed reference values for the empty string, a single label, and multi-label names, and matched every one exactly.

Accuracy Limits: Non-ASCII Labels

  • Plain ASCII input is lowercased automatically before hashing, since ENS names are case-insensitive but namehash itself hashes raw bytes, so skipping that step would make Vault.eth silently produce a different node than the registered vault.eth.
  • An empty input isn’t rejected: it returns the 64-zero-digit node 0x0000000000000000000000000000000000000000000000000000000000000000, ENS’s own root node, exactly as EIP-137 defines it.
  • Two dots in a row, like foo..eth, produces an empty label the algorithm can’t hash meaningfully, so the tool reports “Empty label — remove the extra dot between labels.” rather than silently skipping it.
  • This tool hashes exactly the bytes you typed. It does not run ENSIP-15 Unicode normalization, so a name built from confusable or mixed-script characters may not match the node ENS’s own resolvers compute for the “same” name after their full normalization pass. Stick to ASCII labels when the result needs to match on-chain resolution.

Empty input hashes to the zero node

Namehash
0x012f568ae19a292705aff770afd1bb534a4565ec446c2602bc314221616137df
Recursion, right to left (3 labels)
eth→ keccak256(label) =
0x4f5b812789fc606be1b3b16908db13fc7a9adf7ca72641f84d75b47069d3d7f0
node = keccak256(parentNode + labelHash) =
0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae
finance→ keccak256(label) =
0x2af4c2fb0d9965fa818b9c58b2744b328ab67b082ec92907629457399dacdb35
node = keccak256(parentNode + labelHash) =
0x97f678a47e94edb948f846a4760c975eb8b387997b6d4c3dd93baa28a0d68833
vault→ keccak256(label) =
0x23c14fceac7676b670aa56866076586ea1ce15ddcf19208ec6346cf748dffbee
node = keccak256(parentNode + labelHash) =
0x012f568ae19a292705aff770afd1bb534a4565ec446c2602bc314221616137df

This tool hashes each label's UTF-8 bytes exactly as typed (after auto-lowercasing plain ASCII). It does not run ENSIP-15 Unicode normalization, so a name containing non-ASCII or confusable characters may not match the node ENS's own resolvers compute for that name — stick to ASCII labels for a node you can trust against on-chain resolution.