What is Keccak-256?
Keccak-256 is the original Keccak submission that won the SHA-3 competition, before NIST changed its padding. Ethereum adopted it before FIPS 202 was final, so Ethereum’s "sha3" is Keccak-256 and gives a different digest from SHA3-256.
Solidity developers use it to compute function selectors (the first 4 bytes of the Keccak-256 of the signature) and event topics, and to check keccak256(abi.encodePacked(…)) of plain text.
This page opens the hash generator with Keccak-256 on top and highlighted. The text is encoded as UTF-8 and hashed in your browser as you type; nothing is sent anywhere.
Keccak-256 at a glance
| Keccak-256 | |
|---|---|
| Digest size | 256 bits (64 hex characters) |
| Standard | Keccak (SHA-3 submission) |
| Published | 2012 |
| Secure against attackers | yes |
| Where it is used | Ethereum addresses, Solidity function selectors and event topics |
| Good for passwords | no: use bcrypt or Argon2 |
How to generate a Keccak-256 hash
- Type or paste the text in the input box.
- Read the Keccak-256 row, at the top of the list; it updates as you type.
- To check a known Keccak-256, paste it in the comparison field: the matching row lights up.
Example
Keccak-256 of three inputs, computed by the same code as the tool:
| Input | Keccak-256 (hex) |
|---|---|
hello world | 47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad |
| (empty text) | c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 |
stdlib.tools | 2e2da79eabf4548c79ecbae2cdeb438786ff1f2ad1bd2c5a948b1ed0f14da8d2 |
A single invisible line break changes everything: hello world followed by a newline (what echo prints) gives 70e3788906c57c18999ba6b0389a768ff3333e3d6136fdf85743e66a03bc29f9. When your value does not match, check trailing spaces and line breaks first.
The ERC-20 transfer selector is the first 4 bytes of the Keccak-256 of its signature transfer(address,uint256): 0xa9059cbb. And SHA3-256 of hello world is 644bcc7e564373040999aac89e7622f3ca71fba1d972fd94a31c3bfbf24e3938, a different value from the Keccak-256 above.
Keccak-256 in code
ethers v6
import { keccak256, toUtf8Bytes } from 'ethers';
keccak256(toUtf8Bytes('hello world'));Python (pycryptodome)
from Crypto.Hash import keccak
keccak.new(digest_bits=256, data=b"hello world").hexdigest()Foundry
cast keccak "hello world"Frequently asked questions
Is Keccak-256 still secure?
Yes. Typical uses today: Ethereum addresses, Solidity function selectors and event topics.
How long is a Keccak-256 hash?
256 bits: 64 hexadecimal characters, or 44 characters in Base64 (with padding), such as RxcyhajXNB5ely/GdyhjhPgC+O9CpexfA7v6JUywH60= for hello world.
Why does my Keccak-256 differ from another tool?
The input differs: a trailing newline, spaces or another text encoding (UTF-8 here). Hex is case-insensitive.