Calldata Decoder Guide
Last updated: April 2026
What is Ethereum calldata and how is it encoded?
Calldata is the raw input data sent with an Ethereum transaction when a user or contract calls a function on another smart contract. Every smart contract call on the EVM (Ethereum Virtual Machine) encodes the function to call and its arguments into a compact binary format called ABI encoding. This encoded data is what you see in a transaction's input field on a block explorer — a long hexadecimal string that looks completely unreadable without the right tools.
For example, a simple ERC-20 token transfer might appear as:
0xa9059cbb000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa9604500000000000000000000000000000000000000000000003635c9adc5dea00000Without decoding, this tells you almost nothing. With the Calldata Decoder, it becomes immediately clear that this is a transfer(address,uint256) call sending tokens to a specific address.
How does Ethereum ABI encoding work?
The Ethereum ABI (Application Binary Interface) specification defines how function calls and their parameters are encoded. Every ABI-encoded calldata follows the same structure:
- Function Selector (4 bytes) — The first 4 bytes of the calldata are the function selector. This is computed as the first 4 bytes of the Keccak-256 hash of the function signature. For example,
transfer(address,uint256)hashes to0xa9059cbb. - Encoded Parameters — The remaining bytes encode the function arguments using ABI encoding rules. Fixed-size types like
uint256andaddressare padded to 32 bytes. Dynamic types likestringandbytesuse a two-part encoding with an offset pointer followed by the actual data.
The Calldata Decoder uses the 4byte.directory and on-chain ABI data to look up the function selector and then decodes the remaining bytes according to the matched function signature.
How do I decode raw calldata hex?
Follow these steps to decode any Ethereum calldata:
- Step 1: Navigate to the Calldata Decoder page.
- Step 2: Paste the raw calldata hex string into the input field. Make sure to include the
0xprefix. - Step 3: Click the decode button. The tool will extract the 4-byte function selector, look it up against known function signatures, and decode the parameters.
- Step 4: Review the decoded output, which shows the function name, parameter types, and their values in a human-readable format.
Supported Input Formats
The Calldata Decoder accepts the following input formats:
- Full calldata with
0xprefix — The standard format copied from block explorers or wallet interfaces. - Full calldata without
0xprefix — The tool handles both formats automatically. - Minimum 4 bytes — At least 4 bytes (8 hex characters) are required for the function selector. If no parameters are present, the tool will still identify the function name.
Example: Decoding a USDT Transfer Call
Let's walk through a real example. The following calldata represents a USDT (Tether USD) transfer on Ethereum mainnet:
0xa9059cbb000000000000000000000000ab5801a7d398351b8be11c439e05c5b3259aec9b0000000000000000000000000000000000000000000000000000000077359400Breaking this down:
a9059cbb— Function selector fortransfer(address,uint256)000...ab5801a7d398351b8be11c439e05c5b3259aec9b— The recipient address, padded to 32 bytes000...77359400— The amount in the token's smallest unit (hex77359400= decimal2000000000, which is 2,000 USDT with 6 decimals)
After pasting this into the Calldata Decoder, you will immediately see:transfer(address to, uint256 amount) with the recipient address and amount clearly displayed.
When should I use a calldata decoder?
The Calldata Decoder is most useful when you need to:
- Debug a failed transaction — When a transaction fails, understanding exactly what function was called with what parameters helps identify why it reverted.
- Verify a pending transaction — Before approving a transaction in your wallet, decode the calldata to confirm what the contract will actually execute.
- Audit a smart contract interaction — When reviewing on-chain activity for a protocol or a suspicious transaction, decoding calldata reveals the exact function call.
- Learn ABI encoding — The decoded output with parameter types is a practical way to understand how the Ethereum ABI works in practice.
- Build developer tooling — Quickly prototype calldata parsing logic by verifying your expected decoding against the tool's output.