Skip to main content

EVM Calldata Decoder

Decode Ethereum transaction calldata from raw hex. Parse function selectors, decode ABI arguments, and understand what a transaction is doing.

✓ ABI decode & encode ✓ Selector calculator ✓ Common contract templates

Decode Calldata

Frequently Asked Questions

What is EVM calldata?▼

Calldata is the input data sent with an Ethereum transaction when calling a smart contract function. It's ABI-encoded: the first 4 bytes are the function selector (keccak256 hash of the function signature, first 4 bytes), followed by the ABI-encoded arguments. Understanding calldata is essential for debugging transactions and building EVM tooling.

What is a function selector?▼

A function selector is the first 4 bytes of the keccak256 hash of the function signature. For `transfer(address,uint256)`, the selector is `0xa9059cbb`. Ethereum uses selectors to route calls to the correct function in a contract. You can look up known selectors at 4byte.directory.

How is calldata ABI-encoded?▼

After the 4-byte selector, arguments are ABI-encoded as 32-byte slots. Static types (uint256, address, bool, bytes32) are right-padded or left-padded to 32 bytes. Dynamic types (string, bytes, arrays) have an offset pointer in the static section pointing to the dynamic data location. Addresses are 20 bytes left-padded to 32 bytes.

Why would calldata be 'raw' without a function selector?▼

Raw calldata without a selector appears in: fallback function calls, Ethereum transfer (empty calldata), some proxy patterns, and direct contract construction. In these cases, decode from offset 0 rather than offset 4.

How do I decode a failed transaction's calldata?▼

Get the transaction's `input` field from a block explorer (Etherscan, Basescan). Paste it here or use `cast calldata-decode` from Foundry. Knowing the function signature (from the contract ABI or 4byte.directory) is required for full decoding. The 4-byte selector alone tells you which function was called.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →