Skip to main content

Try it Live

Run Opcode examples in the interactive playground

Opcode Reference Guide

Complete reference for all EVM opcodes with execution traces, stack diagrams, and practical examples.

Quick Lookup by Category

Arithmetic Operations (0x01-0x0B)

All arithmetic operations pop 2 values, perform operation, and push result.
Division by Zero: DIV, SDIV, MOD, SMOD all return 0 if divisor is zero (no revert).
Modulo Operations: Check divisor first.
ADDMOD/MULMOD: Modular arithmetic with 3 operands.

Comparison Operations (0x10-0x14)

All comparison operations pop 2 values and push 1 (true) or 0 (false).
Signed vs Unsigned:

Bitwise Operations (0x16-0x1D)

Memory Operations (0x51-0x53)

Memory is a byte array that grows dynamically. Access costs depend on highest offset touched.
Memory Layout Example:

Storage Operations (0x54-0x55)

Storage is persistent per contract. Each slot holds 256 bits.
EIP-2929 Warm/Cold Access:

Stack Operations (0x50, 0x60-0x7F, 0x80-0x8F, 0x90-0x9F)

Control Flow (0x56-0x5B)

System Operations (0xF0-0xFF)

Execution Trace Example

Complete trace of simple contract execution:

Gas Estimation

Common Patterns

Safe Arithmetic

Storage Slot Access

Delegatecall Pattern