Selector

ABI & calldata

selector & topic calculator

Compute Solidity function selectors, event topics and custom error selectors from a signature, in bulk. Paste a 4-byte selector to look up which function it is.

runs in your browser
try
  • functiontransfer(address,uint256)
  • functionapprove(address,uint256)
  • eventTransfer(address,address,uint256)
  • errorInsufficientBalance(uint256,uint256)

events show their full 32-byte topic0; tap to copy all of it.

good to know

what is a function selector?

the first 4 bytes of keccak256 of the canonical signature, e.g. keccak256("transfer(address,uint256)") starts 0xa9059cbb. it is how the evm picks which function your calldata calls. names of parameters, modifiers and return types are not part of it.

what is an event topic0?

the full 32-byte keccak256 of the event signature. it is the first topic of every log the event emits (unless the event is anonymous), so it is what you filter logs by.

why does one selector match several signatures?

4 bytes is small, so collisions exist, and people register spam signatures on purpose. the most common match is usually right, but confirm it against the verified contract.