Storage Slot Explorer
Visualize how Solidity maps contract variables to 32-byte EVM storage slots. Explore packing, keccak256 addressing, and optimize your layout.
Variable Builder
Contract Templates
Variables
0 variablesAdd variables or load a template to get started
Storage Layout
Add variables to see the storage layout
32-Byte Slot Ruler
Click a variable in the storage layout to highlight its byte range
Storage Efficiency
Add variables to see efficiency
Optimization Suggestions
Your layout is already optimal!
No reordering can reduce the slot count further.
Slot Map
Add variables to see the slot map
Solidity Code
0 variablesAdd variables to generate Solidity code
Learning Guide
Did You Know?
Every Ethereum smart contract has 2^256 storage slots — enough to store more data than atoms in the observable universe, yet it's all addressed by simple 32-byte keys.
Understanding EVM Storage
The EVM allocates 32-byte storage slots to each contract. Fixed-size variables are packed right-to-left when consecutive types fit within 32 bytes. Dynamic types (mappings, arrays, strings) always occupy a full slot, with actual data stored at keccak256-derived addresses. Optimizing variable declaration order can save thousands of gas per contract deployment.
Why Storage Layout Optimization Matters
Each storage slot costs 20,000 gas to initialize. A poorly ordered contract with 10 wasted slots costs 200,000 extra gas on deployment — roughly $15-30 at typical gas prices. For high-traffic contracts, inefficient storage also increases read costs. Understanding storage layout is critical for gas optimization and avoiding storage collision bugs in upgradeable contracts.