Skip to content
All tools

Spacing scale generator

Build a spacing scale in pixels and rem, preview each step and copy the scale as CSS custom properties.

Spacing tokens and equivalent sizes
TokenpxremPreview
--space-140.25
--space-280.5
--space-3120.75
--space-4161
--space-6241.5
--space-8322
--space-12483
--space-16644

CSS variables

:root {
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
}