EVMTools

ABI Encoder / Decoder

Encode and decode Ethereum ABI data. Input function signatures and parameters to generate calldata.

How to Use This ABI Encoder / Decoder

This free online ABI encoder and decoder helps you generate and parse Ethereum calldata for smart contract interactions. Whether you are preparing a transaction, debugging on-chain data, or building a dApp, follow these steps:

  1. Enter a function signature such as transfer(address,uint256) or paste a full JSON ABI to select from available functions.
  2. Provide parameter values for each argument in the function. The tool validates types and shows errors for invalid inputs like malformed addresses or out-of-range numbers.
  3. Click Encode to generate the complete calldata including the 4-byte function selector and encoded parameters.
  4. To decode, paste raw calldata into the decode tab along with the function signature, and the tool will parse each parameter back into its readable form.

Everything runs locally in your browser. Your data is never sent to a server, making this tool safe for sensitive contract interactions and private key operations.

Common Use Cases

  • Transaction preparation — Generate calldata for token transfers, approvals, and other contract interactions before sending through a wallet or multisig.
  • Debugging failed transactions — Decode calldata from failed transactions on Etherscan to understand what parameters were passed and identify issues.
  • Multisig proposals — Create encoded calldata for Gnosis Safe or other multisig wallet proposals that require raw transaction data.
  • Smart contract testing — Verify that your encoding logic matches expected calldata before deploying contracts or scripts to mainnet.
  • Cross-chain bridging — Encode messages and function calls for cross-chain protocols that require raw calldata payloads.

Related Tools

Frequently Asked Questions

What is Ethereum ABI encoding?

ABI (Application Binary Interface) encoding is the standard way to encode data for Ethereum smart contract interactions. It converts human-readable function calls and parameters into the hexadecimal calldata format that the EVM (Ethereum Virtual Machine) understands. The encoding follows a strict specification defined in the Solidity ABI specification.

How do I encode a function call for a smart contract?

To encode a function call, you need the function signature (e.g., 'transfer(address,uint256)') and the parameter values. The encoder computes the 4-byte function selector from the keccak256 hash of the signature, then ABI-encodes each parameter according to its type and appends them. The result is the complete calldata you can send in a transaction.

What is the difference between ABI encoding and ABI decoding?

ABI encoding converts human-readable function names and parameters into raw hexadecimal calldata for the EVM. ABI decoding does the reverse — it takes raw calldata or return data and parses it back into readable types and values. Decoding requires knowing the function signature or ABI to interpret the data correctly.

What types does ABI encoding support?

ABI encoding supports all Solidity types including uint8 through uint256, int8 through int256, address, bool, bytes1 through bytes32, fixed-size arrays, dynamic arrays, strings, bytes (dynamic), and tuples (structs). Each type has specific encoding rules for padding and alignment.

How are dynamic types encoded in the ABI?

Dynamic types like strings, bytes, and dynamic arrays are encoded using an offset-pointer system. The head section contains a 32-byte offset pointing to where the data starts in the tail section. The tail section begins with a 32-byte length prefix followed by the actual data, padded to 32-byte boundaries.

Can I use ABI encoding to interact with any EVM chain?

Yes. ABI encoding is a universal standard across all EVM-compatible blockchains including Ethereum, Polygon, Arbitrum, Optimism, BSC, Avalanche, and others. The same encoded calldata works on any chain that runs the EVM, making it the standard for cross-chain tooling.