Build Ethereum contract calldata from a canonical function signature and JSON arguments, decode transaction input hex, parse event logs from topics and data, or encode raw ABI parameters without a selector. Compare selectors with Keccak-256, copy full calldata for cast and ethers, and debug ERC-20 transfers locally — nothing uploaded.
Canonical Solidity form without spaces or names: transfer(address,uint256). You can prefix with function.
One JSON array matching parameter types. Addresses and bytes as 0x strings; integers as numbers or strings (e.g. "1000000000000000000"). Tuples and arrays nest as JSON.
Function selector
0xa9059cbb
Encoded arguments
0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000de0b6b3a7640000
Full calldata
0xa9059cbb00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000de0b6b3a7640000
Encoding and decoding run in your browser with viem. Do not paste private keys or production secrets.
When you call a smart contract, your wallet sends hex calldata: a four-byte function selector followed by ABI-encoded arguments. The selector is the first four bytes of Keccak-256 of the canonical signature string — for example `transfer(address,uint256)` becomes `0xa9059cbb`. Arguments are packed according to the Solidity ABI spec: 32-byte words, dynamic types offset-encoded, structs and arrays nested as defined in your interface. Decoding reverses that process for debugging, analytics, and security review. Event logs split data differently: topic[0] is the event signature hash, indexed parameters fill further topics, and non-indexed fields sit in the log data payload. This tool runs encode and decode locally with viem so you can verify calldata before a mainnet transaction, inspect mempool calls, or teach ABI layout without pasting secrets into a random pastebin.
Canonical function signature = `name(type1,type2,…)` with no spaces, no parameter names, only types (use `uint256` not `uint`, `int256` not `int` in signatures). selector = first 4 bytes of keccak256(UTF-8 signature). encodedArgs = ABI encode of the parameter tuple. fullCalldata = selector ‖ encodedArgs (hex). For raw parameter encoding without a selector, use comma-separated types with `encodeAbiParameters`. Decoding uses the same signature to split the selector and unpack words. Events use `event Name(types…)`; topic[0] = keccak256(event signature); indexed args are ABI-encoded in topics[1..]; non-indexed args are in `data`. Compare outputs with `cast calldata`, `cast abi-decode`, `ethers.Interface`, or Foundry scripts — they must match for the same canonical string and values.
Signature transfer(address,uint256), args ["0x000…001", "1000000000000000000"] (1 token with 18 decimals).
Selector 0xa9059cbb + 32-byte padded address + 32-byte uint256 amount.
Paste the full hex into the Decode tab to recover the recipient and amount — useful when auditing wallet transactions.
Event Transfer(address,address,uint256) with indexed from and to in topics[1] and topics[2], value in data.
topic[0] is the event selector; decode merges indexed and non-indexed fields into named args.
Block explorers show the same breakdown — this page helps when you only have raw RPC log JSON.
approve(address,uint256) with max uint256.
Selector 0x095ea7b3 with spender address and 2^256−1.
Common DeFi flow — encode here to double-check spender and amount before signing.
balanceOf(address) with a holder address.
Same calldata format even for read-only eth_call — no ETH sent, only ABI payload.
Useful for scripting eth_call payloads without opening a full IDE.
For education only — not financial advice. Past performance does not guarantee future results.