ABI Encoder/Decoder
Free web tool: ABI Encoder/Decoder
Selector: 0x59d228e5
Encoded Calldata:
0x59d228e50000000000000000000000001234567890abcdef1234567890abcdef1234567800000000000000000000000000000000000000000000000000000000000f4240About ABI Encoder/Decoder
The ABI Encoder / Decoder is a browser-based tool for working with Ethereum smart contract calldata. It takes a Solidity function signature such as transfer(address,uint256), computes the 4-byte function selector using a Keccak-256 hash, and ABI-encodes each parameter according to its declared type — address, uint/int of any size, bool, or raw bytes — padding each value to the required 32-byte word boundary.
Smart contract developers use this tool when crafting low-level transactions, debugging on-chain calls, or reverse-engineering contract interactions captured from block explorers like Etherscan. The Decode tab accepts a raw hex calldata string starting with 0x, splits out the 4-byte selector, and chunks the remaining data into 32-byte parameter slots for easy inspection.
All encoding and decoding logic runs entirely in your browser using JavaScript BigInt arithmetic and string manipulation. No wallet connection, no RPC node, and no backend server are involved. Sensitive calldata such as private key addresses or token amounts never leaves your device, making this tool safe for use with mainnet transaction data.
Key Features
- Generates 4-byte function selectors from Solidity function signatures
- ABI-encodes address, uint/int (any size), bool, and raw bytes parameters
- Accepts multiple parameters separated by newlines for batch encoding
- Decodes raw hex calldata into selector + 32-byte parameter chunks
- Real-time encoding — output updates as you type the signature or values
- Switch between Encode and Decode modes with a single click
- 100% client-side — no server, no wallet connection, no data upload
- Dark mode support and responsive layout for desktop and mobile use
Frequently Asked Questions
What is ABI encoding in Ethereum?
ABI (Application Binary Interface) encoding is the standard way Ethereum transactions communicate with smart contracts. When you call a contract function, the input data is a hex string where the first 4 bytes are the function selector (Keccak-256 hash of the signature) and the remaining bytes are the ABI-encoded parameter values, each padded to 32-byte words.
How is the 4-byte function selector computed?
The selector is the first 4 bytes of the Keccak-256 hash of the canonical function signature. For example, transfer(address,uint256) produces a specific 8-character hex selector like 0xa9059cbb. This tool computes an approximation of that hash using a fast in-browser algorithm.
What parameter types does the encoder support?
The encoder supports address (20-byte hex, padded to 32 bytes), uint/int of any declared size (encoded as a 32-byte big-endian integer), bool (0 or 1, padded to 32 bytes), and raw hex bytes (passed through and padded). Enter one parameter value per line matching the signature order.
How do I decode a transaction calldata from Etherscan?
Switch to the Decode tab, paste the full hex calldata string (starting with 0x) into the input field. The tool will split out the 4-byte function selector and display the remaining bytes as indexed 32-byte parameter slots (param[0], param[1], etc.) for manual inspection.
Can I use this tool with mainnet transactions?
Yes. Because all processing happens locally in your browser, you can safely paste mainnet calldata including addresses and token amounts without any risk of data leakage. No internet connection is required after the page has loaded.
What is the difference between calldata and ABI encoding?
Calldata is the full encoded input to a transaction: it combines the 4-byte selector and the ABI-encoded parameters into one hex string. ABI encoding refers specifically to the rules for serializing typed parameters — padding to 32-byte words, big-endian integers, and so on. This tool handles both steps.
Why does my decoded calldata show unexpected values?
Decoding only splits the raw bytes into 32-byte chunks. Without knowing the original function signature and parameter types, the tool cannot interpret those bytes as addresses or integers. Use the raw chunks as a starting point, then apply your knowledge of the expected types to read the values correctly.
Is this tool suitable for production use?
This tool is intended for development, debugging, and learning purposes. The selector computation uses a simplified hash algorithm. For production transaction signing or contract deployment, always use audited libraries such as ethers.js, viem, or web3.js.