0.5 rem to px = 8px
0.5 rem equals 8 pixels at the default root font size of 16px. Adjust the root size below to recalculate.
What’s 0.5rem used for?
0.5rem (8px at default root) is the standard 'small' spacing token — tight padding inside buttons and badges, the gap between an icon and its label, the inner spacing of dense form components. It's the smallest spacing value most design systems expose; below this, layouts start to feel cramped. Tailwind's spacing-2 lands here.
How it works
To convert 0.5rem to pixels, multiply by the root font size: 0.5 × 16 = 8. The rem unit is relative to the root element’s font size, which browsers default to 16px.
0.5rem at different root sizes
If you’ve overridden the html root font size, the pixel equivalent of 0.5rem shifts. Here’s 0.5rem at common root sizes.
| Root size | 0.5rem in px |
|---|---|
| 16px (default) | 8px |
| 12px | 6px |
| 14px | 7px |
| 18px | 9px |
| 20px | 10px |
| 24px | 12px |
0.5rem in CSS
Use 0.5rem as compact spacing inside dense components.
.badge {
padding: 0.5rem 1rem;
gap: 0.5rem;
}FAQ
Is 0.5rem the same as 8px?
Yes, at the browser default root font size of 16px. If the root has been changed (some sites use html { font-size: 62.5% } or similar), the conversion changes — see the table above for 0.5rem at other root sizes.
Why use 0.5rem instead of 8px?
Because 0.5rem scales with the user’s browser font-size preference, and 8px does not. If a user enlarges their default font size for accessibility, anything sized in rem scales proportionately — including this value. Use rem for type and type-adjacent properties; reach for px only when the value must stay fixed regardless of user settings.