What ABI encoding actually does
Ethereum contracts only understand raw bytes. When you call a function like transfer(address, uint256), your wallet or script has to turn that function name and its arguments into a single hex string — the calldata — following the rules in the contract’s Application Binary Interface (ABI). The first 4 bytes are a “selector”, derived from hashing the function signature, that tells the contract which function to run; everything after is the arguments, packed into fixed-width 32-byte words.
Why you’d decode calldata
Block explorers show you calldata as an opaque hex blob unless they have the contract’s ABI verified. If you’re reviewing a transaction before signing it, auditing a multisig proposal, or debugging a failed call, decoding that hex back into readable arguments — a spender address, an amount, a deadline — is often the fastest way to confirm a transaction does what it claims to.
How this tool works
Enter a plain Solidity-style signature — no full ABI JSON required. In Encode mode, fill in each argument and get the exact calldata plus the 4-byte selector. In Decode mode, paste calldata against the same signature to get each argument back out, typed and labeled. Everything runs through viem entirely in your browser.