Solidity Event Hash Calculator
Calculate keccak256 hashes for Solidity event signatures. Get topic 0 values for filtering Ethereum logs.
Common Solidity Events
Indexed vs Non-Indexed Parameters
In Solidity events, parameters marked as indexed are stored in log topics (topics[1], topics[2], topics[3]), while non-indexed parameters are ABI-encoded in the log data field.
Topics are searchable, so indexed parameters can be used to filter logs efficiently. Ethereum allows a maximum of 3 indexed parameters per event (plus topics[0] which is always the event signature hash).
Note: Anonymous events do not include the signature hash in topics[0], allowing them to have up to 4 indexed parameters.
How to Use This Event Hash Calculator
This free online tool calculates the keccak256 hash (topic 0) for Solidity event signatures. Use it to build log filters, verify event topics, and understand how Ethereum logs are indexed.
- Enter an event signature such as
Transfer(address,address,uint256). Use the canonical form with parameter types only (no parameter names or spaces). - View the topic 0 hash — the full keccak256 hash of the event signature that identifies this event type in logs.
- Copy the hash to use in your log filter queries, subgraph definitions, or indexing code.
- Browse common events in the reference table to quickly find topic hashes for standard ERC-20 and ERC-721 events.
All hashing runs locally in your browser. No data is sent to any server.
Common Use Cases
- Log filtering — Get the topic 0 hash to filter specific events using eth_getLogs or eth_subscribe RPC calls.
- Subgraph development — Verify event topic hashes when defining event handlers in The Graph subgraph manifests.
- Block explorer analysis — Identify unknown events by comparing topic 0 values from transaction logs with known event signatures.
- Monitoring and alerting — Set up on-chain monitoring by filtering for specific event topics in real-time log subscriptions.
- Smart contract testing — Verify that emitted events match expected topic hashes in your test assertions.
Related Tools
Function Selector Lookup
Calculate 4-byte function selectors from Solidity function signatures using the same keccak256 method.
Keccak256 Hash Generator
Generate Keccak256 hashes for any input including event signatures, function signatures, and arbitrary data.
ABI Encoder / Decoder
Decode the non-indexed data field of event logs using ABI specifications.
Frequently Asked Questions
What are Ethereum event logs?
Event logs are a way for smart contracts to emit data that is stored on the blockchain but not accessible to other contracts. Logs are indexed by topics (up to 4) and stored in the transaction receipt. They are significantly cheaper than storage writes and are the primary mechanism for dApps to track on-chain activity using filters and subscriptions.
What is topic 0 in Ethereum event logs?
Topic 0 (also called topic[0]) is the keccak256 hash of the event signature. For example, the Transfer(address,address,uint256) event has topic 0 = 0xddf252ad... This hash uniquely identifies the event type and is used to filter logs. Anonymous events do not have a topic 0.
How are indexed parameters stored in event topics?
Indexed parameters are stored in topics 1 through 3 (up to 3 indexed parameters per event). Value types like address, uint256, and bool are stored directly as 32-byte padded values. Reference types like string and bytes are stored as their keccak256 hash, which means the original value cannot be recovered from the log alone.
What is the difference between indexed and non-indexed event parameters?
Indexed parameters are stored in log topics and can be used as filters when querying logs (e.g., find all Transfer events to a specific address). Non-indexed parameters are ABI-encoded together in the log data field and cannot be filtered. You can have at most 3 indexed parameters per event (4 topics total including topic 0).
How do I filter Ethereum logs by event?
To filter logs, use the eth_getLogs or eth_subscribe JSON-RPC methods with a topics filter. Set topics[0] to the keccak256 hash of the event signature. You can also filter by indexed parameter values in topics[1] through topics[3]. This tool calculates the topic 0 hash you need for filtering.
What are anonymous events in Solidity?
Anonymous events are declared with the 'anonymous' keyword and do not include the event signature hash as topic 0. This allows them to have up to 4 indexed parameters instead of 3. However, anonymous events cannot be filtered by event type using topic 0, making them harder to identify in log queries.
Related Tools & Guides
ABI Encoder / Decoder
Encode and decode Ethereum ABI data. Input function signatures and parameters to generate calldata.
Keccak256 Hash Generator
Generate Keccak256 hashes from text input. The hash function used by Ethereum and Solidity.
ERC-20 Token Info Decoder
Decode ERC-20 token function calls and event logs from raw transaction data.
Try Also
Calldata Decoder
Decode raw Ethereum calldata hex into human-readable function calls and parameters.
UTF-8 / Hex / Bytes Converter
Convert between UTF-8 text, hexadecimal strings, and byte arrays. Essential for encoding and debugging Ethereum data.
Function Selector Lookup
Calculate Solidity function selectors from signatures using keccak256. Browse a table of 30+ common ERC-20, ERC-721, and Ownable selectors.