frontendhack-logo
24px = 1.5rem

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 sizeInputResult
10px24px2.4rem
12px24px2rem
14px24px1.7143rem
15px24px1.6rem
16px24px1.5rem
18px24px1.3333rem
20px24px1.2rem
22px24px1.0909rem
24px24px1rem

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

PixelsREM
24px1.5rem
2px0.125rem
3px0.1875rem
4px0.25rem
5px0.3125rem
6px0.375rem

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.