# ABI Decoder/Encoder: Read Any Calldata, Build Any Function Call, Right in Your Browser

## Every contract call boils down to a hex string. This tool turns that hex string back into something you can actually read — and back again.

Paste any calldata — a `transfer`, an `approve`, a DEX swap — and pick or type the function signature you think it matches. The tool computes the real function selector from that signature with `keccak256` and checks it against the first 4 bytes of your calldata live, as you type. Get it right and you see a green match badge with the selector; get it wrong and you know immediately, before wasting time decoding against the wrong ABI.

Decoding isn't limited to a handful of simple types. `address[]` arrays, nested tuples written as `(type1,type2)`, strings, bytes — anything Solidity's ABI encoding supports, this decodes, each parameter shown as its own row with an index, a type badge, the decoded value, and a one-click copy button.

![Decoded calldata parameters](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/jk434fdbm48783feuvgd.jpg)

## Decoding is only half the tool

Switch to Encode mode and the same signature input now drives a form: one input per parameter, type-aware — a plain text box for most types, comma-separated values for arrays, JSON-array syntax for tuples. Fill them in and it builds the exact calldata a wallet or script would need to send, with the selector prepended automatically.

This closes the loop that most ABI tools leave open: you can decode a transaction you're inspecting, tweak a value, and re-encode it into calldata to actually send — without ever touching a second tool or writing a script.

![Encode mode form](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/gk97p822qdh77qm5lz5j.jpg)

## Everything runs in your browser, nothing is uploaded

Decoding and encoding both happen client-side using `ethers.js`. Your contract addresses, calldata, and parameter values never leave the page — there's no server round-trip, no logging, no rate limit. Paste calldata from a block explorer, a failed transaction, or a contract you're auditing, and read it privately.

A few examples are built in to get started fast: a plain ERC-20 `transfer`, an `approve`, and a Uniswap-style `swapExactTokensForTokens` call that exercises the `address[]` array path — decode any of them instantly to see the tool handle both simple and dynamic types correctly.
