Tools / UI/UX Design

Generate a consistent spacing token scale from a base unit and preset (linear, compact, comfortable) or custom multipliers. Export CSS custom properties and a Tailwind-friendly snippet, with a live preview of padding, gaps, and button spacing.

Inputs
px
Default 4px is common for 4-point grids
px
Used only for rem conversion
Letters, numbers, hyphens: e.g. space → --space-0
Live UI previewPadding, gaps, and button spacing update from your scale.
Sample cardPadding, gaps, and button spacing update from your scale.
ChipChip
Primary action
Generated spacing tokens
Token×pxremPreview
--space-0000
--space-1140.25
--space-2280.5
--space-33120.75
--space-44161
--space-55201.25
--space-66241.5
--space-78322
--space-810402.5
--space-912483
--space-1016644
CSS custom properties
:root {
  /* Generated spacing scale, rem assumes 16px root font size */
  --space-0: 0px; /* 0rem · ×0 */
  --space-1: 4px; /* 0.25rem · ×1 */
  --space-2: 8px; /* 0.5rem · ×2 */
  --space-3: 12px; /* 0.75rem · ×3 */
  --space-4: 16px; /* 1rem · ×4 */
  --space-5: 20px; /* 1.25rem · ×5 */
  --space-6: 24px; /* 1.5rem · ×6 */
  --space-7: 32px; /* 2rem · ×8 */
  --space-8: 40px; /* 2.5rem · ×10 */
  --space-9: 48px; /* 3rem · ×12 */
  --space-10: 64px; /* 4rem · ×16 */
}
Tailwind-friendly snippet
// Tailwind theme.extend.spacing (values in rem; root = 16px)
spacing: {
  "0": "0rem",
  "1": "0.25rem",
  "2": "0.5rem",
  "3": "0.75rem",
  "4": "1rem",
  "5": "1.25rem",
  "6": "1.5rem",
  "7": "2rem",
  "8": "2.5rem",
  "9": "3rem",
  "10": "4rem",
}
  1. 01
    Token px = base spacing unit × multiplier.
  2. 02
    Token rem = token px ÷ assumed root font size (default 16px).
  3. 03
    CSS custom properties use a sanitized prefix (e.g. --space-3).
  4. 04
    Presets supply multiplier lists; custom mode uses the multipliers you enter.

Worked example. Base 4px, root 16px, linear multipliers. Token ×3 → 12px → 0.75rem. CSS: --space-3: 12px.

AuditUI/UX Audit

Your numbers show a leak. An audit shows the screen.

$19.99$149.99
Get the audit