Free Spacing Scale Generator
Something not working? Report a problem
About the Spacing Scale Generator
Generate a consistent spacing scale from a base unit and ratio — preview each step as a coloured bar and copy as CSS custom properties or a Tailwind config, all in your browser.
How to use the Spacing Scale Generator
- 1Set a base unit (the smallest spacing increment, e.g. 4px).
- 2Choose a scale type — Linear multiplies by a fixed step; Modular multiplies by a ratio.
- 3Select how many steps you need in your scale.
- 4Copy the CSS custom properties or Tailwind config and add them to your project.
Frequently asked questions
What is a spacing scale?
A spacing scale is a predefined set of margin, padding and gap values that keep your UI consistent. Instead of arbitrary pixel values, every element uses a value from the scale — typically powers of 2 or a modular ratio of a base unit.
What base unit should I use?
4px is the most popular base for web UIs (it's the default in Tailwind CSS). 8px gives a chunkier feel. Designers working with 8-point grids use 8px. Stick to one base across your project.
Linear vs modular — which should I use?
Linear scales (multiply by 2, 4, 8…) are predictable and easy to remember. Modular scales (ratio like 1.5×) grow exponentially and create more dramatic size differences at the large end.
Is this tool client-side only?
Yes — all computation runs in your browser. No data leaves your machine.