What the 4-Byte Selector Means: How Contracts Find a Function
A call to transfer(address,uint256) starts with 0xa9059cbb. Those four bytes are Keccak-256 of the canonical signature, and the hash does not give the name back.
Call transfer(address,uint256) and the calldata opens with 0xa9059cbb. Those are the first four bytes of Keccak-256 over that exact string. The ABI specification in the Solidity docs says which string gets hashed. The examples below were recomputed against it on 10 November 2026.
The four bytes name the signature. They do not prove the contract contains the function. The words after them can mean something other than you expect, and you check the target address on its own.
The hash covers one canonical string
What gets hashed is the function name plus the parameter types in parentheses. A comma separates the types, with no space. Parameter names, the word function, and data locations such as memory or calldata stay out of the string. For the selector, uint and int are written uint256 and int256. address and bool stay address and bool.
transfer(address,uint256) yields 0xa9059cbb. The same Keccak run matches the specification's examples: baz(uint32,bool) starts with 0xcdcd77c0, and sam(bytes,bool,uint256[]) starts with 0xa5643bf2.
| What you type | What is hashed | Selector |
|---|---|---|
transfer(address,uint256) | that same string | 0xa9059cbb |
function transfer(address to, uint amount) | transfer(address,uint256) | 0xa9059cbb |
transfer(address,uint) in the selector tool | transfer(address,uint256) (rewritten by the tool) | 0xa9059cbb |
Raw string transfer(address,uint) | that text, with no rewriting | 0x6cb927d8 |
Rows two and three are what the Function Selector prints: parsed, uint rewritten to uint256, then hashed. Row four is the same text without that rewrite. Solidity lets you write uint. The selector hashes uint256.
The same string transfer(address,uint256) starts with 0xa9059cbb under Keccak-256 and with 0x4b40e901 under SHA-3-256. NIST standardized SHA-3 later. Use the wrong function and you look up a different selector.
Four bytes cannot be reversed
Four bytes have 2^32 possible values. The signature does not follow from the selector alone. Two different canonical signatures can share the same first four bytes. A table only shows signatures somebody entered ahead of time.
Type a signature and the Function Selector on this site hashes it from scratch. Paste a selector and it only searches a local list of common functions, including ERC-20, ERC-721, and ERC-1155. If the selector is missing from that list, the display stays a hash. The input can still be valid. The function can be ordinary and simply absent from the list.
When no function on the contract matches the signature, a fallback may run. The Solidity documentation allows at most one fallback and runs it when nothing else matches the signature. Whether this contract is built that way is not in the selector.
How to check a selector without sending anything
Open the Function Selector and paste transfer(address,uint256). You get 0xa9059cbb and the canonical signature. Paste 0xa9059cbb next. The local table names transfer(address,uint256), because that signature is on the list. A selector that is not on the list stays unnamed.
You can open that signature in the ABI Decoder. The selector says which function is supposed to be called. The 32-byte words that follow are covered in How calldata is laid out.
Sources:
Specification and recomputation
- Solidity: Contract ABI Specification (selector, canonical signature,
bazandsamexamples). Retrieved 10 November 2026. - Solidity: Fallback Function. Retrieved 10 November 2026.
- Selectors
0xa9059cbb,0x6cb927d8, and0x4b40e901: recomputed with Keccak-256 (ethers) and SHA-3-256 (Node.js) on 10 November 2026. The specification examples0xcdcd77c0and0xa5643bf2were the check that the same Keccak function was in use.
Continue reading