At the default root font size of 16px, 8rem is exactly 128px.
Calculation based on a root font-size of 16 pixels.
How to convert 8rem to px
To convert rem to pixels, multiply the rem value by the root font size: px = rem × 16. For 8rem that is 8 × 16 = 128px.
128px is a very large size, typically used for hero headings, containers and big layout dimensions.
8rem at different root font sizes
| Root font size | Input | Result |
|---|---|---|
| 10px | 8rem | 80px |
| 12px | 8rem | 96px |
| 14px | 8rem | 112px |
| 15px | 8rem | 120px |
| 16px | 8rem | 128px |
| 18px | 8rem | 144px |
| 20px | 8rem | 160px |
| 22px | 8rem | 176px |
| 24px | 8rem | 192px |
CSS examples
font-size: 8rem; /* 128px */
padding: 8rem;
margin-bottom: 8rem;
width: 8rem;The same values in pixels, if you need a fixed size:
font-size: 128px;
padding: 128px;Tailwind CSS equivalent
The default spacing scale has a step for 8rem: use classes like p-32, m-32, gap-32, w-32 and h-32. As a font size, 8rem is the default text-9xl class.
Nearby values
Frequently Asked Questions
8rem equals 128px when the root font size is the browser default of 16px. The calculation is 8 × 16 = 128.
128px equals 8rem at a 16px root font size (128 ÷ 16 = 8).
Yes. rem is relative to the root font size, so 8rem becomes 144px at an 18px root and 160px 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.
