function selector calculator
compute the 4-byte function selector and the 32-byte event topic from a solidity function or event signature — keccak-256, for any EVM contract, entirely in your browser.
what is a function selector?
when you call a contract function, the EVM identifies it by a function selector: the first 4 bytes of the keccak-256 hash of the function's canonical signature. for example, transfer(address,uint256) hashes to 0xa9059cbb…, so its selector is 0xa9059cbb. that selector is the first four bytes of every transaction's calldata, followed by the encoded arguments.
canonical signatures
the signature must be canonical: the function name, then parameter types in parentheses, separated by commas, with no parameter names and no spaces — transfer(address,uint256), not transfer(address to, uint256 amount). tuples are written as parenthesized type lists, e.g. swap((address,uint256),bool). errors use the same 4-byte scheme as functions; events use the full 32-byte hash as their topic.
related tools & reading
to go the other way — match a selector or decode a transaction's full input data against an ABI — use the calldata decoder, or open the read · write workbench to call functions and look up selectors against a loaded ABI. new to this? read function selectors explained.