Space things in steps of 4 or 8 pixels, and layouts stay consistent.
A multiple-of-8 (or 4) scale gives consistent rhythm and predictable layouts.
By Rohit Sonawane, product designer · Last reviewed 16 November 2026
The 8-point spacing scale is a rule for spacing in UI design: every margin, padding and gap is a multiple of 8 pixels (with 4 for tight spots), such as 8, 16, 24, 32 and 48. Using a fixed set of steps makes layouts consistent and quick to build.
Pick a spacing scale and reuse it. Equal, predictable gaps are what make a layout feel calm.
Pick {4, 8, 12, 16, 24, 32, 48} and use only those values, never arbitrary ones.
Choose a fixed set of spacing steps, say 4, 8, 12, 16, 24, 32, 48, and use only those, and a layout snaps into rhythm: gaps repeat, cards line up, and nothing lands on a stray 13px by accident. Most systems, including Material and the token sets behind shared Figma libraries, build on a 4 or 8 base for exactly this reason. Eight also divides cleanly across common screen densities, so edges stay crisp.
Hairline borders, focus rings, and optical alignment often need sub-scale values like 1px or 2px that no 8-point step covers, and that is fine: the scale governs layout spacing, not every measurement. Dense professional tools may also adopt a tighter 4-point base so more information fits without feeling cramped.
Every gap in the design is one of your scale values, and related items sit visibly closer together than unrelated ones.
Eight divides evenly on common screen densities (1x, 1.5x, 2x, 3x), so spacing stays sharp on every device. It also halves cleanly to 4 for small gaps. Google's Material Design uses an 8dp grid for this reason.
A 4-point grid gives finer control, which helps dense interfaces and small text. Many teams use 8 as the main step and 4 for small adjustments, such as the gap between an icon and its label.
Not strictly. Font sizes usually follow a type scale, but line heights are often set to multiples of 4 or 8 so text lines up with the rest of the layout.
A teammate's profile card uses gaps of 6, 11, and 13px — no scale, just values nudged by eye. It looks subtly broken and no one on the team can say exactly why.