Free online tools to generate, calculate,
convert, format, encode, and play.
 

ABI Encoder / Decoder

Encode Solidity function calls or decode transaction calldata using a contract ABI. All processing runs locally in your browser.


ABI Input

Parses as you type.

Quick Examples


How It Works

The Ethereum Application Binary Interface (ABI) defines how to encode function calls and decode return data for smart contracts. Every external call to a contract is encoded as a sequence of bytes called calldata.

Calldata Structure

Encoded calldata consists of two parts:

  1. Function selector — The first 4 bytes, computed as the Keccak-256 hash of the function signature (e.g., transfer(address,uint256)). This identifies which function to call.
  2. Encoded arguments — The remaining bytes encode each argument according to ABI rules. Static types (uint256, address, bool) are padded to 32 bytes. Dynamic types (string, bytes, arrays) use an offset-based encoding with a pointer in the head and the data in the tail.

Common ABI Types

TypeSizeEncoding
uint25632 bytesZero-padded left
address20 bytesZero-padded left to 32 bytes
bool1 byte0 or 1, padded to 32 bytes
bytes3232 bytesRight-padded
stringDynamicOffset + length + UTF-8 data
bytesDynamicOffset + length + raw data
T[]DynamicOffset + count + encoded elements
T[N]Static/DynamicN concatenated encoded elements

Function Selector Examples

  • transfer(address,uint256) → 0xa9059cbb
  • approve(address,uint256) → 0x095ea7b3
  • balanceOf(address) → 0x70a08231

Embed This Util

You can embed this util on your own site as a widget. Adding ?embed=1 to the URL loads a compact version with just the tool itself; no header, menu, or documentation. Paste this snippet into your HTML:


    

Copy snippet Adjust the height to taste.



Feedback

Help us improve this page by providing feedback, and include your name/email if you want us to reach back. Thank you in advance.


Share with