EVMTools

Keccak256 Hash Generator

Generate Keccak256 hashes from text input. The hash function used by Ethereum and Solidity.

Input mode:

Common Solidity Function Signatures

How to Use This Keccak256 Hash Generator

This free online Keccak256 hash generator computes hashes instantly for any input. It is the same hash function used throughout Ethereum for addresses, selectors, storage, and more.

  1. Enter text or hex input into the input field. Select the input mode (UTF-8 text or hex bytes) depending on your data.
  2. View the hash output — the 32-byte Keccak256 hash appears instantly as you type.
  3. Copy the full hash or the first 4 bytes (function selector) using the copy buttons.
  4. Use the result for computing function selectors, verifying storage slots, or any other Ethereum development task.

Everything runs locally in your browser. No data is sent to any server, making this safe for hashing sensitive data.

Common Use Cases

  • Function selector calculation — Hash a Solidity function signature to get the 4-byte selector used in calldata.
  • Storage slot computation — Calculate mapping and array storage slot locations for reading contract state directly.
  • Event topic generation — Hash event signatures to get topic[0] for filtering logs in Ethereum nodes and subgraphs.
  • Commit-reveal schemes — Generate commitment hashes for on-chain commit-reveal patterns in voting, auctions, and games.
  • Address derivation verification — Verify that an Ethereum address is correctly derived from a public key by hashing and comparing.

Related Tools

Frequently Asked Questions

What is Keccak256 and how is it used in Ethereum?

Keccak256 is the cryptographic hash function at the core of Ethereum. It takes an arbitrary input and produces a fixed 32-byte (256-bit) hash. Ethereum uses Keccak256 for computing addresses from public keys, generating function selectors, calculating storage slots, creating event topic hashes, and building Merkle trees. It is technically different from the NIST SHA-3 standard, which uses different padding.

What is the difference between Keccak256 and SHA-3?

Keccak256 and SHA-3 use the same underlying algorithm (Keccak) but different padding schemes. NIST added domain separation bits when standardizing SHA-3, so identical inputs produce different hashes. Ethereum was developed before SHA-3 was finalized and adopted the original Keccak256. This is why Solidity's keccak256() produces different output from a SHA-3 library.

How does Solidity use keccak256 for function selectors?

Solidity computes a function selector by taking the first 4 bytes of the keccak256 hash of the function's canonical signature. For example, keccak256('transfer(address,uint256)') produces a hash, and the first 4 bytes (0xa9059cbb) become the selector. This selector is prepended to the encoded arguments in calldata to identify which function to call.

How are Ethereum addresses derived from Keccak256?

An Ethereum address is derived by taking the keccak256 hash of the public key (64 bytes, without the 0x04 prefix) and then taking the last 20 bytes of the resulting hash. This creates the 40-character hex address. The EIP-55 checksum is also computed using keccak256 of the lowercase hex address.

Can Keccak256 hashes be reversed?

No. Keccak256 is a one-way cryptographic hash function. It is computationally infeasible to determine the original input from a hash output. This property (preimage resistance) is what makes it suitable for commitments, proofs, and security-critical operations in Ethereum. You can only verify a hash by hashing the suspected input and comparing.

How is Keccak256 used for Solidity storage slots?

Solidity uses keccak256 to compute storage slot locations for dynamic data. Mapping values are stored at keccak256(key . slot), where '.' is concatenation. Dynamic arrays store elements starting at keccak256(slot). This ensures storage locations are spread uniformly across the 2^256 address space, avoiding collisions.