Calldata Decoder Guide

What Is Calldata?

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:

0xa9059cbb000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa9604500000000000000000000000000000000000000000000003635c9adc5dea00000

Without 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.

ABI Encoding Basics

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 to 0xa9059cbb.
  • Encoded Parameters — The remaining bytes encode the function arguments using ABI encoding rules. Fixed-size types like uint256 and address are padded to 32 bytes. Dynamic types like string and bytes use 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 to Use the Calldata Decoder

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 0x prefix.
  • 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 0x prefix — The standard format copied from block explorers or wallet interfaces.
  • Full calldata without 0x prefix — 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:

0xa9059cbb000000000000000000000000ab5801a7d398351b8be11c439e05c5b3259aec9b0000000000000000000000000000000000000000000000000000000077359400

Breaking this down:

  • a9059cbb — Function selector for transfer(address,uint256)
  • 000...ab5801a7d398351b8be11c439e05c5b3259aec9b — The recipient address, padded to 32 bytes
  • 000...77359400 — The amount in the token's smallest unit (hex 77359400 = decimal 2000000000, 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.

Common Use Cases

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.