ABI Decoder & Encoder

Decode calldata and event logs, or encode function calls, using any contract ABI.

How to use the ABI Decoder & Encoder

  1. Paste a contract ABI — JSON or human-readable signatures — into the Contract ABI box.
  2. Choose a tab: Decode Calldata, Encode Function, or Decode Event Log.
  3. Fill in the calldata, function + arguments, or topics + data for that tab, then click the action button.
  4. Copy the decoded function/event name and arguments, or the generated calldata, from the output panel.

All three tabs share the same ABI input, so you can switch between decoding and encoding the same contract without re-pasting it.

How This Tool Works

The ABI Decoder & Encoder parses the contract ABI you paste — either a JSON ABI array (as produced by solc or Etherscan) or newline-separated human-readable signatures like `function transfer(address,uint256) returns (bool)` — using the viem library, entirely in your browser.

Decode Calldata matches the calldata's 4-byte selector against every function in the ABI and decodes the remaining bytes into named arguments. Encode Function does the reverse: pick a function and supply its arguments as a JSON array to produce ready-to-send calldata. Decode Event Log matches topics and data against the ABI's events to recover the event name and its indexed and non-indexed arguments.

Nothing you paste — ABI, calldata, topics, or event data — is ever sent to a server. All parsing, decoding, and encoding happens client-side in your browser's JavaScript engine.

Frequently Asked Questions

Advertisement

Related tools

Advertisement