Keccak-256 hash generator for Ethereum
Keccak is the sponge-based hash that won NIST’s SHA-3 competition. Before the standard was finalised, NIST changed the padding rule, so the published SHA-3 functions differ from the original Keccak. Ethereum had already adopted the original, and it still uses Keccak-256 everywhere. This tool computes original Keccak-224, -256, -384 and -512.
Example: a Solidity function selector
Input (function signature):
transfer(address,uint256)Keccak-256:
a9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049bThe first four bytes, a9059cbb, are the function selector for the ERC-20 transfer function — the value that appears at the start of the call data of every token transfer. SHA3-256 of the same text is 4b40e901eada9ab2…, which is why using the wrong function breaks contract calls.
Keccak vs SHA-3
| Keccak-256 (original) | SHA3-256 (FIPS 202) | |
|---|---|---|
| Padding domain byte | 0x01 | 0x06 |
| Permutation, rate, capacity | Identical | Identical |
| Used by | Ethereum, Solidity, many EVM chains | Standards, general cryptography |
| Output for the same input | Different | Different |
Libraries are not always clearly named: in some JavaScript and Python packages, a function called “sha3” actually computes Keccak-256. When results do not match, this difference is the first thing to check. For the standard version, use SHA3-256.
Common Ethereum uses
- Function selectors: first 4 bytes of
keccak256("name(type1,type2)")— no spaces, canonical type names such asuint256. - Event topics: the full 32-byte hash of the event signature, e.g.
Transfer(address,address,uint256). - Addresses: the last 20 bytes of the Keccak-256 hash of the uncompressed public key (without its 0x04 prefix byte).
- Storage slots and mapping keys in contract storage layout.
To see exactly which bytes a signature string consists of before hashing, convert it with String to Hex.
Text vs bytes
This tool hashes the UTF-8 bytes of the text you type. That is right for signatures such as transfer(address,uint256). To hash binary data such as a public key or ABI-encoded values, the input must be the raw bytes, not their hex text — hashing the string “0xabc…” gives a different result. Developer libraries (ethers.js keccak256, web3.py Web3.keccak) accept byte arrays for that purpose.
Keccak is a fast hash and not a way to protect secrets such as seed phrases or private keys; never paste those into any website. Hashing here happens locally.
Reference values to check your setup
Well-known Ethereum hashes make good test inputs. If the tool, your library and a block explorer all agree on these, you are using the right function:
| Input | Keccak-256 |
|---|---|
Transfer(address,address,uint256) | ddf252ad…f523b3ef, the ERC-20 Transfer event topic |
Approval(address,address,uint256) | 8c5be1e5…c7c3b925, the Approval event topic |
balanceOf(address) | selector 70a08231 |
| empty input | c5d24601…5d85a470, the code hash of accounts with no code |
The most common signature mistakes are writing uint instead of uint256, adding spaces after commas and including parameter names. All three change the hash completely.