At the default root font size of 16px, 128px is exactly 8rem.
Calculation based on a root font-size of 16 pixels.
How to convert 128px to rem
To convert pixels to rem, divide the pixel value by the root font size: rem = px ÷ 16. For 128px that is 128 ÷ 16 = 8rem.
128px is a very large size, typically used for hero headings, containers and big layout dimensions.
128px at different root font sizes
| Root font size | Input | Result |
|---|---|---|
| 10px | 128px | 12.8rem |
| 12px | 128px | 10.6667rem |
| 14px | 128px | 9.1429rem |
| 15px | 128px | 8.5333rem |
| 16px | 128px | 8rem |
| 18px | 128px | 7.1111rem |
| 20px | 128px | 6.4rem |
| 22px | 128px | 5.8182rem |
| 24px | 128px | 5.3333rem |
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
128px equals 8rem when the root font size is the browser default of 16px. The calculation is 128 ÷ 16 = 8.
8rem equals 128px at a 16px root font size (8 × 16 = 128).
Yes. If the root font size is 18px, 128px equals 7.1111rem, and at 20px it equals 6.4rem. The pixel value itself never changes, only the rem equivalent. 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.
