Keccak

Hashing & encoding

keccak256 hasher

Hash a UTF-8 string or raw hex bytes with keccak256 (what Solidity uses) or SHA-256. See the byte length and the bytes32 result instantly.

runs in your browser
try
keccak256
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
sha256
0x2fb30cfca4728c7f62d6787ef949fc7943d813f5093ebc6c343c6cc6f3ec1a56
first 4 bytes (bytes4)
0xddf252ad
input as hex
0x5472616e7366657228616464726573732c616464726573732c75696e7432353629
solidity
keccak256(bytes("Transfer(address,address,uint256)"))

good to know

is keccak256 the same as sha3-256?

no. ethereum uses the original keccak, before nist changed the padding for the final sha3-256 standard. the same input gives different hashes, which is why generic sha3 tools give the wrong answer.

text or hex?

keccak256("hello") in solidity hashes the utf-8 bytes of the string. keccak256(hex"68656c6c6f") hashes the raw bytes: same result here. pick hex when you hold encoded data.