4-Byte Selector Lookup
Compute 4-byte function selectors or 32-byte event topic hashes from a Solidity signature, or look up known signatures for a given selector hash. All processing runs locally in your browser.
Signature Input
Result
Hash Lookup
Known Signatures
Quick Examples
How It Works
In the Ethereum Virtual Machine (EVM), every function call to a smart contract begins with a 4-byte selector that identifies which function to execute. This selector is derived from the function's canonical signature using Keccak-256 hashing.
Function Selectors
A function selector is the first 4 bytes of the Keccak-256 hash of the function's canonical signature. The canonical form uses only parameter types (no names, no spaces), for example:
transfer(address,uint256)→0xa9059cbbapprove(address,uint256)→0x095ea7b3balanceOf(address)→0x70a08231
When you call a contract function, the transaction's input data starts with this 4-byte selector followed by the ABI-encoded arguments.
Event Topic Hashes
Events use a similar mechanism but with the full 32-byte Keccak-256 hash (not truncated to 4 bytes).
This hash becomes the first topic (topic0) in log entries:
Transfer(address,address,uint256)→0xddf252ad...Approval(address,address,uint256)→0x8c5be1e5...
Selector Collisions
Because selectors are only 4 bytes (232 possibilities), different function signatures can produce the same selector. This is called a collision. While rare for common functions, it is important when verifying which function a selector corresponds to. Public databases like 4byte.directory and OpenChain catalogue known signature-to-selector mappings.
Common Selectors
| Selector | Function Signature | Standard |
|---|---|---|
| 0xa9059cbb | transfer(address,uint256) | ERC-20 |
| 0x095ea7b3 | approve(address,uint256) | ERC-20 |
| 0x70a08231 | balanceOf(address) | ERC-20 |
| 0x23b872dd | transferFrom(address,address,uint256) | ERC-20 |
| 0x18160ddd | totalSupply() | ERC-20 |
| 0xdd62ed3e | allowance(address,address) | ERC-20 |
| 0x42842e0e | safeTransferFrom(address,address,uint256) | ERC-721 |
| 0x6352211e | ownerOf(uint256) | ERC-721 |
Related Utils
Feedback
Help us improve this page by providing feedback, and include your name/email if you want us to reach back. Thank you in advance.
Sending...
Feedback sent. Thank you!
Error occurred!
-
-
-
-
-
-
-
- ABI Encoder / Decoder
- Block Estimator
- Calldata Cost
- CREATE2 Address
- ENS Availability
- ENS Cost Estimator
- ENS Lookup
- ENS Namehash
- ENS Record Viewer
- ENS Subname Explorer
- ERC-20 Unit Converter
- Gas Estimator
- HD Wallet Derivation
- Merkle Tree Visualizer
- 4-Byte Selector Lookup
- Solidity Storage Layout
- Transaction Decoder
- Vanity Address Estimator
- Wallet Address Validator
- Wei/Gwei/Ether Converter
-
-
-
-
-
- API Response
- ASCII Table
- Code Bug Detector
- Code Explanation
- CSS Beautifier
- Env Parser
- GraphQL Query
- Syntax Highlight
- HTML Beautifier
- JS Beautifier
- JSON Formatter
- JSONPath
- JWT Decoder
- JS keyCodes
- API Lorem Ipsum
- RegExp
- Regex Library
- Semver Compare
- SQL Beautifier
- TOML Formatter
- Code Unminifier
- XML Beautifier
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Amortization
- Break-Even
- Compound Interest
- Crypto Profit/Loss
- Debt Payoff
- Discount
- Effective Interest
- Emergency Fund
- Inflation Calculator
- Simple Interest
- Invoice Calculator
- IRR Calculator
- Mortgage
- NPV Calculator
- Portfolio
- Profit Margin
- Rent vs Buy
- Retirement Calc
- ROI Calculator
- Salary vs Hourly
- Savings Goal
- Tax Calculator
- VAT
-
-
-
-
-
-
-
-
-
-
-
-
- Equation Solver
- Exponent Calculator
- Factorial Calculator
- Fibonacci Sequence
- Fraction Calculator
- Fraction Simplifier
- GCD Calculator
- GCD/LCM
- Least Common Multiple (LCM) Calculator
- Logarithm Calculator
- Magic Square
- Matrix Calculator
- Number Base Converter
- Pascal's Triangle
- PDE Solver
- Prime Checker
- Prime Factorization
- Roman Numbers
- Scientific Notation
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Broken Link Checker
- Canonical URL Checker
- Core Web Vitals Checker
- Favicon
- Heading Structure
- Keyword Density
- Meta Tags
- Mobile-Friendly Test
- Open Graph Tags
- Page Load Time Analyzer
- Redirect Checker
- robots.txt
- Schema Markup
- SEO Optimized Checklist
- XML Sitemap
- Time on Page Tracker
- Page Title & Desc.
- Twitter Card Generator
-
-
-
-
-
-
- Acceleration
- Substance Amount
- Angle
- Area
- Astronomical
- Base Converter
- Capacitance
- Electric Charge
- Data Transfer
- Data Storage
- Density
- Energy Converter
- Force Converter
- Frequency Converter
- Fuel Economy
- Illuminance
- Inductance
- Length / Distance
- Power
- Pressure
- Electrical Resistance
- Time
- Speed
- Temperature
- Viscosity
- Volume
- Weight
-
-
-
-
-