At the default root font size of 16px, 24px is exactly 1.5rem.
Calculation based on a root font-size of 16 pixels.
How to convert 24px to rem
To convert pixels to rem, divide the pixel value by the root font size: rem = px ÷ 16. For 24px that is 24 ÷ 16 = 1.5rem.
24px is a medium size, common for body text, subheadings, buttons and standard spacing. It is often used for section subheadings and generous spacing.
24px at different root font sizes
| Root font size | Input | Result |
|---|---|---|
| 10px | 24px | 2.4rem |
| 12px | 24px | 2rem |
| 14px | 24px | 1.7143rem |
| 15px | 24px | 1.6rem |
| 16px | 24px | 1.5rem |
| 18px | 24px | 1.3333rem |
| 20px | 24px | 1.2rem |
| 22px | 24px | 1.0909rem |
| 24px | 24px | 1rem |
CSS examples
font-size: 1.5rem; /* 24px */
padding: 1.5rem;
margin-bottom: 1.5rem;
width: 1.5rem;The same values in pixels, if you need a fixed size:
font-size: 24px;
padding: 24px;Tailwind CSS equivalent
The default spacing scale has a step for 1.5rem: use classes like p-6, m-6, gap-6, w-6 and h-6. As a font size, 1.5rem is the default text-2xl class.
Nearby values
Frequently Asked Questions
24px equals 1.5rem when the root font size is the browser default of 16px. The calculation is 24 ÷ 16 = 1.5.
1.5rem equals 24px at a 16px root font size (1.5 × 16 = 24).
Yes. If the root font size is 18px, 24px equals 1.3333rem, and at 20px it equals 1.2rem. 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.
