← All tools

Spacing Scale Generator

Preview spacing tokens by name and multiplier, then export CSS, Tailwind config or SCSS.

design-system-spacingLOCAL WORKSPACE

Enabling local controls…

Settings

Separate names and multipliers with commas. rem values assume a 16px root font.

Results

Spacing scale
Name×pxremVisual
3xs0.520.125
2xs140.25
xs280.5
sm3120.75
md4161
lg5201.25
xl6241.5
2xl8322
3xl10402.5
4xl12483
5xl16644
6xl20805

CSS

:root {
  --spacing-3xs: 0.125rem;
  --spacing-2xs: 0.25rem;
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.25rem;
  --spacing-xl: 1.5rem;
  --spacing-2xl: 2rem;
  --spacing-3xl: 2.5rem;
  --spacing-4xl: 3rem;
  --spacing-5xl: 4rem;
  --spacing-6xl: 5rem;
}
Download CSS

How to use this tool

Choose a preset or edit the controls. Copy the result or download it when it is ready.

When not to use it

The rem value assumes a 16px root. The Tailwind export uses a CommonJS configuration file.