Spacing Calculator

Spacing & Grid System Calculator

Build a consistent spacing scale using the industry-standard 4px / 8pt grid. Choose your device and see ready-to-use values, layouts, and live examples.

1. Base Configuration

The base unit is the foundation of your entire spacing system. Every value in your design - padding, margin, gap, container - is a multiple of this number.

4px
Base Unit
System
8pt Grid
Multiplier
4 / 8 / 12...

Why 4px / 8pt grid?

The 8pt grid is the global standard used by Apple, Google, Microsoft, Airbnb, and almost every major design system. Spacing values stay in multiples of 8 (8, 16, 24, 32...) with a half-step of 4 for fine control.

Why it matters: Multiples of 4/8 divide cleanly across all common screen sizes. Your design stays sharp on retina displays, scales predictably across breakpoints, and feels visually consistent across every component you build.

2. Grid System

Recommended grid for desktop screens (1280px+).

Columns
12
Container
1280px
Gutter
32px
Margin
64px
Column visualization

3. Common Layout Presets

Pre-configured spacing combinations for common UI sections. Click any preset to see exact values.

4. Where to Use Each Size

Every spacing value has a purpose. Use this guide to pick the right size for the right element.

5. Live Examples

See exactly how each spacing value looks in real UI components. All examples below use values from the scale above.

How to Use in Your Designs
Practical spacing rules for UI/UX designers
01
Stick to the Scale
Never use random values like 13px, 27px, or 41px. Always pick from your spacing scale. This is the single most important spacing rule.
02
Group Related Items
Use smaller spacing (4-12px) between related items, larger spacing (24-64px) between unrelated sections. This creates clear visual hierarchy.
03
Scale Down on Mobile
Desktop spacing feels too generous on mobile. Reduce section padding (64-96 → 32-48) and margins (64 → 16-20) for smaller screens.
04
Limit Your Scale
Use 6-8 spacing values max in a project. Too many sizes confuse the eye and make decisions harder. Less is more.
05
Padding vs Margin
Padding goes inside a component (button padding, card padding). Margin goes between components. Get this right and your layouts stay clean.
06
Use Variables in Code
Define your scale as CSS variables (--space-1, --space-2...) or Figma variables. Future-you will thank present-you.
Pro Tip: When in doubt, double the spacing. New designers almost always use too little spacing. Generous white space looks professional and lets content breathe. Crowded layouts look amateur.