At the default root font size of 16px, 240px is exactly 15rem.
Calculation based on a root font-size of 16 pixels.
How to convert 240px to rem
To convert pixels to rem, divide the pixel value by the root font size: rem = px ÷ 16. For 240px that is 240 ÷ 16 = 15rem.
240px is a very large size, typically used for hero headings, containers and big layout dimensions.
240px at different root font sizes
| Root font size | Input | Result |
|---|---|---|
| 10px | 240px | 24rem |
| 12px | 240px | 20rem |
| 14px | 240px | 17.1429rem |
| 15px | 240px | 16rem |
| 16px | 240px | 15rem |
| 18px | 240px | 13.3333rem |
| 20px | 240px | 12rem |
| 22px | 240px | 10.9091rem |
| 24px | 240px | 10rem |
CSS examples
font-size: 15rem; /* 240px */
padding: 15rem;
margin-bottom: 15rem;
width: 15rem;The same values in pixels, if you need a fixed size:
font-size: 240px;
padding: 240px;Tailwind CSS equivalent
The default spacing scale has a step for 15rem: use classes like p-60, m-60, gap-60, w-60 and h-60.
Nearby values
Frequently Asked Questions
240px equals 15rem when the root font size is the browser default of 16px. The calculation is 240 ÷ 16 = 15.
15rem equals 240px at a 16px root font size (15 × 16 = 240).
Yes. If the root font size is 18px, 240px equals 13.3333rem, and at 20px it equals 12rem. 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.
