Array Storage Demo
Configure a Solidity array and visualize how elements map to 32-byte EVM storage slots with packing, keccak256 addressing, and gas costs.
Quick Scenarios
Array Configuration
Array Kind
Element Type
Length5
050
Base Slot
uint256[] public myArray;Total Slots
6
Elements
5
Bytes Used
160B / 160B
Efficiency
100%
Storage Slots
length (32B)
[0]
[1]
[2]
[3]
[4]
Element Access Calculator
Element Index
Slot
0x290dec…f3e563 + 0
Byte Offset
bytes 0\u201331
Formula
dataStart = keccak256(0) slot = dataStart + floor(0 × 32 / 32) = 0x290dec…f3e563 + 0 offset = (0 × 32) % 32 = 0
uint25632B per element1 per slot
Gas Costs
Initialize all elements120,000 gas
5 data slots × 20,000 + 1 length slot × 20,000
Read element (SLOAD)
2,100 cold SLOAD + ~30 keccak256
Write element (SSTORE)
5,000 gas to update existing slot value
push() — append
~27,100 gas (new slot + length update)
pop() — remove last
~7,900 gas (zero element + length update, refund eligible)
Dynamic arrays use slot for length, data at keccak256(slot). One extra SLOAD per access.