Convert design-system base units to pixels using a configurable base size (8px by default, the common 8-point grid). When tokens are expressed as multiples of a base unit, this resolves them to exact pixels. The table below uses an 8px base.
| Base units | Pixels |
|---|---|
| 0.5 | 4px |
| 1 | 8px |
| 2 | 16px |
| 3 | 24px |
| 4 | 32px |
| 5 | 40px |
| 6 | 48px |
| 8 | 64px |
| 10 | 80px |
| 12 | 96px |
A base unit is the smallest spacing increment your design system uses — typically 4px or 8px. Once chosen, every margin, padding, gap, and element height becomes a multiple of that unit. Tailwind uses 4px; Material Design uses 8px; some legacy systems use 5px. The discipline produces visually consistent layouts because all spacing decisions align to the same rhythm.
8 is the most popular base unit because it's divisible into 4 (for finer adjustments via 0.5 units), it produces sizes that look right at common screen densities, and it matches Material Design and many design system guides. The 8-point grid encourages rounded, screen-friendly values like 8, 16, 24, 32, 48, 64 — which happen to look great. Change the default to 4 for a Tailwind-style scale or 10 for a decimal-friendly scale.
Rem scales with the user's browser font-size preference and is meant for accessibility — change the root and everything resizes. Base units don't scale; they enforce visual rhythm independent of font-size. A button at 6 base units (48px at base 8) stays 48px regardless of user font preference, which is sometimes what you want for icon buttons, fixed UI chrome, or fixed-size cards.
Yes — values like 0.5 (4px at base 8) or 1.5 (12px) are common for finer spacing increments. Tailwind exposes these as spacing-0.5, spacing-1.5, etc. This calculator handles fractional values to four decimal places, though in practice 0.5 and 0.25 cover almost every fractional use case.
Design systems often define a base spacing unit (commonly 4px or 8px) to maintain visual rhythm. The formula is px = units × baseSize. The base defaults to 8px (used by Material Design, Carbon, and many custom systems) but is fully configurable. A reference table maps fractional and whole units to their pixel equivalents, useful for translating design tokens to CSS values.