The 8px Spacing System Explained
UI Design

The 8px Spacing System Explained

Jun 20, 2026 · 6 min read · By Editorial Team

Random padding values (13px, 17px, 23px) are a hallmark of amateur design. A spacing system fixes this instantly.

The 8px Spacing System Explained
Cover illustration for this article

The 8px Grid

All spacing uses multiples of 8: 8, 16, 24, 32, 48, 64. This aligns with most screen densities and creates visual rhythm.

Component Spacing Rules

  • Inside buttons: 8px vertical, 16px horizontal
  • Between form fields: 16–24px
  • Section padding: 48–64px desktop, 32px mobile
  • Card internal padding: 24px

Pro Tip

Define spacing tokens in CSS: --space-xs: 4px; --space-sm: 8px; --space-md: 16px; --space-lg: 24px; --space-xl: 48px;