Skip to content
All designer tools

Spacing Scale Generator

Linear or modular spacing tokens in px or rem

Base unit4px

The 1× step every other step is derived from. 4px and 8px are the common grid bases; md always equals this value.

Steps8

How many stops the ladder has. Fewer steps force clearer decisions; more steps risk neighbours that are visually identical.

Multiples of the base: 0.5×, 1×, 2×, 3×… Even gaps that map cleanly onto a pixel grid.

rem is computed at the 16px browser default, so tokens scale with the user's font-size preference.

Keep this scale. This browser remembers what you last had open. A free account remembers the ones you name, on every machine you use.

Spacing scale (linear, 4px base)
sm
2px · 0.125rem
md
4px · 0.25rem
lg
8px · 0.5rem
xl
12px · 0.75rem
2xl
16px · 1rem
3xl
20px · 1.25rem
4xl
24px · 1.5rem
5xl
28px · 1.75rem
cssCSS variables
:root {
  --space-sm: 0.125rem; /* 2px */
  --space-md: 0.25rem; /* 4px */
  --space-lg: 0.5rem; /* 8px */
  --space-xl: 0.75rem; /* 12px */
  --space-2xl: 1rem; /* 16px */
  --space-3xl: 1.25rem; /* 20px */
  --space-4xl: 1.5rem; /* 24px */
  --space-5xl: 1.75rem; /* 28px */
}
jsTailwind config
// tailwind.config.js
module.exports = {
  theme: {
    extend: {
      spacing: {
          'sm': '0.125rem',
          'md': '0.25rem',
          'lg': '0.5rem',
          'xl': '0.75rem',
          '2xl': '1rem',
          '3xl': '1.25rem',
          '4xl': '1.5rem',
          '5xl': '1.75rem',
      }
    }
  }
}
jsonJSON
{
  "sm": "0.125rem",
  "md": "0.25rem",
  "lg": "0.5rem",
  "xl": "0.75rem",
  "2xl": "1rem",
  "3xl": "1.25rem",
  "4xl": "1.5rem",
  "5xl": "1.75rem"
}

Now use it on something

Every effect, block, page and template in the catalog is styled against tokens shaped exactly like these — so they take your values rather than fighting them.

Hand these tokens to an agent

npx shadcn@latest add https://hoverlab.dev/r/hoverlab.json

More designer tools

All 36 run in the tab — no account, no upload.See all