Skip to main content

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 variables

Add variables or load a template to get started

Storage Layout

Add variables to see the storage layout

32-Byte Slot Ruler

0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

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 variables

Add 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.

Frequently Asked Questions