ABI Encoder / Decoder

Encode a function call into calldata, or decode calldata back into arguments — straight from a Solidity-style signature.

Selector0xa9059cbb
 

"" is not a valid address

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.

Frequently asked questions

A Solidity-style function signature, e.g. transfer(address to, uint256 amount). You don't need a full ABI JSON file — just the function header.

Calldata is the hex-encoded byte string sent as the data field of a transaction. It starts with a 4-byte function selector (the first 4 bytes of the keccak256 hash of the function signature), followed by the ABI-encoded arguments.

Not with this tool — decoding requires the exact signature the calldata was encoded with, since the selector alone doesn't reveal argument types. If you only have a selector, look it up on a 4-byte directory like openchain.xyz first.

Not yet. This tool currently supports primitive types (address, uintN, intN, bool, bytesN, string) and arrays of them. Tuple support is planned.

No. All parsing, encoding, and decoding happens locally in your browser using viem — nothing is transmitted over the network.