EVMTools

Function Selector Lookup

Calculate Solidity function selectors from signatures using keccak256. Browse a table of 30+ common ERC-20, ERC-721, and Ownable selectors.

Try These Signatures

About Function Selectors

  • A function selector is the first 4 bytes of the keccak256 hash of the function signature
  • The EVM uses selectors to dispatch calls to the correct function
  • Signature format: functionName(type1,type2) -- no spaces, no parameter names
  • Selectors are used in calldata, event topics, and interface detection (ERC-165)

How to Use This Function Selector Lookup

This free online tool calculates Solidity function selectors from function signatures and provides a reference table of common selectors for ERC-20, ERC-721, and other standard interfaces.

  1. Enter a function signature in canonical form, such as transfer(address,uint256). Use only type names without parameter names or spaces.
  2. View the 4-byte selector and full keccak256 hash computed from your signature.
  3. Browse the reference table of 30+ common selectors for ERC-20, ERC-721, and Ownable functions to quickly find what you need.
  4. Copy any selector for use in calldata construction, proxy implementation, or transaction analysis.

Everything runs locally in your browser. No data is transmitted to any server.

Common Use Cases

  • Transaction decoding — Identify which function was called by matching the first 4 bytes of transaction calldata against known selectors.
  • Proxy contract development — Check for selector collisions when building proxy patterns, diamond proxies (EIP-2535), or transparent proxies.
  • Low-level calls — Construct calldata manually using abi.encodeWithSelector in Solidity or equivalent in other languages.
  • Interface verification — Verify that your contract implements the correct selectors for ERC-165 interface detection.
  • Security auditing — Identify functions in bytecode by matching known selectors from the JUMPI dispatch table.

Related Tools

Frequently Asked Questions

What is a Solidity function selector?

A function selector is the first 4 bytes of the keccak256 hash of a function's canonical signature. It identifies which function to call in a smart contract. For example, the selector for 'transfer(address,uint256)' is 0xa9059cbb. When you send a transaction to a contract, the first 4 bytes of calldata are the function selector.

How is a function selector calculated?

Take the function name followed by parameter types in parentheses with no spaces (e.g., 'balanceOf(address)'). Compute the keccak256 hash of this UTF-8 string, then take the first 4 bytes (8 hex characters). This produces the selector that the EVM uses for function dispatch.

What is the canonical form of a function signature?

The canonical form uses only the function name and parameter types without parameter names, return types, or visibility modifiers. Tuple types are expanded to their component types in parentheses. For example, 'function transfer(address to, uint256 amount) external returns (bool)' has the canonical form 'transfer(address,uint256)'.

Can two functions have the same selector?

Yes, this is called a selector collision. Since selectors are only 4 bytes, there are about 4.3 billion possible values, and collisions exist. Solidity prevents collisions within a single contract at compile time. However, collisions across different contracts can be exploited in proxy patterns, which is why EIP-1967 and diamond proxies include collision checks.

What are the most common ERC-20 function selectors?

Common ERC-20 selectors include: transfer(address,uint256) = 0xa9059cbb, approve(address,uint256) = 0x095ea7b3, transferFrom(address,address,uint256) = 0x23b872dd, balanceOf(address) = 0x70a08231, totalSupply() = 0x18160ddd, and allowance(address,address) = 0xdd62ed3e.

How do I look up an unknown function selector?

You can search for known selectors in databases like 4byte.directory or Openchain. If the selector is not in any database, you cannot reverse it (keccak256 is one-way). This tool lets you compute selectors from signatures you suspect, so you can compare against the unknown selector.