At the default root font size of 16px, 0.5rem is exactly 8px.
Calculation based on a root font-size of 16 pixels.
How to convert 0.5rem to px
To convert rem to pixels, multiply the rem value by the root font size: px = rem × 16. For 0.5rem that is 0.5 × 16 = 8px.
8px is a small size, common for captions, labels, small text and tight spacing. It is often used for the core unit of the popular 8-point spacing system.
0.5rem at different root font sizes
| Root font size | Input | Result |
|---|---|---|
| 10px | 0.5rem | 5px |
| 12px | 0.5rem | 6px |
| 14px | 0.5rem | 7px |
| 15px | 0.5rem | 7.5px |
| 16px | 0.5rem | 8px |
| 18px | 0.5rem | 9px |
| 20px | 0.5rem | 10px |
| 22px | 0.5rem | 11px |
| 24px | 0.5rem | 12px |
CSS examples
font-size: 0.5rem; /* 8px */
padding: 0.5rem;
margin-bottom: 0.5rem;
width: 0.5rem;The same values in pixels, if you need a fixed size:
font-size: 8px;
padding: 8px;Tailwind CSS equivalent
The default spacing scale has a step for 0.5rem: use classes like p-2, m-2, gap-2, w-2 and h-2.
Nearby values
Frequently Asked Questions
0.5rem equals 8px when the root font size is the browser default of 16px. The calculation is 0.5 × 16 = 8.
8px equals 0.5rem at a 16px root font size (8 ÷ 16 = 0.5).
Yes. rem is relative to the root font size, so 0.5rem becomes 9px at an 18px root and 10px at a 20px root. Use the base font size field above to try any value.
Prefer rem for font sizes, spacing and layout so they respect the user's browser font settings and scale for accessibility. Use px for details that should never scale, such as 1px borders or fixed icon sizes.
