Spacing Scale Generator

Consistent spacing scales for design systems

Ad placeholder (leaderboard)

A spacing scale is the small, fixed set of spacing values a design system allows for padding, margin, and gap. Picking values from a defined scale instead of ad hoc numbers is what makes a UI feel rhythmic and consistent. This generator builds that scale from a single base unit and a growth rule, then hands you the code.

How it works

Each step is derived from the base unit and the chosen growth strategy:

geometric:  step(n) = base × ratio^n
linear:     step(n) = base × (1 + (ratio − 1) × n)

For a 4px base with a 1.5 ratio, the geometric scale produces roughly 4, 6, 9, 14, 20, 30, 46, 68. Every value is rounded to the nearest whole pixel for crisp rendering, and the rem equivalent is that pixel value divided by 16 (the default root font size).

Tips and example

Stick to one base unit across the whole product — mixing a 4-point and a 5-point system is the fastest way to lose visual consistency. Geometric scales give a pleasing acceleration for components that nest (card padding much larger than inline gaps), while a linear scale is easier to reason about for tabular or form-heavy layouts. Export to CSS custom properties when you want framework-free tokens, or to the Tailwind config when your team already lives in utility classes such as p-3 and gap-5.

Ad placeholder (rectangle)