Ethereum ABI Encoder/Decoder
Encode Solidity values to ABI hex and decode ABI hex back to values. Supports all primitive types, arrays, and tuples.
Encode Values
Decode ABI Hex
Encoded Output
Decoded Values
Frequently Asked Questions
What is Ethereum ABI encoding?▼
ABI (Application Binary Interface) encoding is how Ethereum represents function arguments and return values as raw bytes. It's used in calldata, event logs, and function return data. Static types are padded to 32-byte slots. Dynamic types (bytes, string, arrays) use an offset/length scheme where the static section holds a pointer to the dynamic data location.
What is the difference between abi.encode and abi.encodePacked?▼
abi.encode pads all types to 32-byte boundaries — safe and unambiguous. abi.encodePacked concatenates types without padding — smaller output but can be ambiguous (e.g., abi.encodePacked('a','bc') == abi.encodePacked('ab','c')). Never use encodePacked for signatures or hash inputs that combine dynamic types, as it can enable hash collision attacks.
How are events ABI-encoded in logs?▼
Event logs have up to 4 topics (32 bytes each) and arbitrary data. The first topic is the event selector (keccak256 of the event signature). Indexed parameters go into topics (up to 3). Non-indexed parameters go into data as ABI-encoded values. Dynamic types (string, bytes, arrays) when indexed are keccak256-hashed — you can't reverse this.
What is a struct in ABI encoding?▼
Structs are encoded as tuples in ABI. A struct with fields (uint256 a, address b) is encoded as tuple(uint256,address). The encoding follows the same rules as regular ABI — static fields are at their offsets, dynamic fields use pointer indirection. Nested structs are recursively encoded.
How do I decode a Revert error?▼
Revert with a reason string encodes as: selector for Error(string) = 0x08c379a0, followed by ABI-encoded string offset + length + data. Custom errors use their own selector + ABI-encoded arguments. You can decode a revert reason by removing the 4-byte selector and decoding the remaining data as ABI-encoded (string) or custom error types.
Related Products
on GumroadDeveloper Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →AI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →Developer Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
Buy on Gumroad →You Might Also Need
EVM Calldata Decoder
Decode Ethereum transaction calldata from raw hex. Parse function selectors, decode ABI-encoded arguments for all Solidity types, and analyze transaction input data.
Open free tool →
Smart Contract Gas Estimator
Estimate Ethereum smart contract gas costs in USD. Compare operation costs across mainnet, Arbitrum, Optimism, and Base L2 networks.
Open free tool →
Multi-Chain Wallet Address Validator
Validate cryptocurrency wallet addresses across Ethereum, Bitcoin, Solana, TRON, and EVM chains. Check EIP-55 checksum and detect address format.
Open free tool →
More Free Tools
Related Articles
Solidity Smart Contract Development Best Practices 2026
Master Solidity smart contract development in 2026. Security patterns, reentrancy protection, OpenZeppelin, Hardhat/Foundry testing, gas optimization, ERC standards, and a production-ready audit checklist.
Base64 Encode/Decode Explained: When and How to Use It
Understand when to use Base64 encoding and when to avoid it. This guide explains the Base64 algorithm, practical use cases, code examples in JavaScript, Python, Go, and more.
Base64 Encode Decode Online: Complete Developer Guide
Everything developers need to know about Base64 encoding and decoding—how it works, when to use it, URL-safe vs standard, plus a free browser-based Base64 encode decode tool.
Base64 Decode Online: Instantly Decode Any Base64 String for Free
Decode Base64 strings instantly online — JWT payloads, API image data, env vars, and SSH keys. No install needed, no account. URL-safe variant supported.
Base64 Encode Decode Online — Instant Browser-Based Converter
Base64 encode decode online — convert text, JSON, binary, and images to Base64 and back in seconds. No install, no signup, fully private. Learn how Base64 works with practical code examples.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →