24px → REM
24px to REM — 1.5rem at 16px Base
At the default browser root size of 16px, 24px equals
1.5rem. Formula: rem = px ÷ 16.
Last reviewed:
CSS snippet
.example {
font-size: 1.5rem; /* 24px at 16px root */
padding: 1.5rem;
} PX to REM formula
rem = px ÷ root font size
24px ÷ 16px = 1.5rem Worked example: To convert 24px at a 16px root, divide 24 by 16.
24 ÷ 16 = 1.5. Write font-size: 1.5rem;
instead of font-size: 24px; so
text scales when users enlarge their browser default font size.
Common use cases at 24px (1.5rem)
| Category | Tailwind / design use | CSS property example |
|---|---|---|
| Font size | text-2xl (1.5rem) | font-size: 1.5rem; |
| Spacing | p-6, gap-6 | padding: 1.5rem; |
| Gap / margin | p-6, gap-6 | gap: 1.5rem; |
Nearby pixel conversions
Also see 20px to rem
and 30px to rem
.
24px to REM FAQ
How do you convert 24px to rem?
Divide 24 by the root font size. At the default 16px base: 24 ÷ 16 = 1.5rem. Formula: rem = px ÷ root font size.
What is 24px in rem at 16px base?
At a 16px root font size, 24px equals exactly 1.5rem. This is the browser default unless your project or the user changes html { font-size }.
Should I use 1.5rem or 24px in CSS?
Use 1.5rem for typography and spacing that should scale with the user's root font-size preference — important for accessibility. Reserve 24px for fixed values like 1px borders or bitmap image dimensions.
How do I convert 1.5rem back to pixels?
Multiply 1.5rem by 16: 1.5 × 16 = 24px. Reverse formula: px = rem × root font size.
Where is 24px commonly used in web design?
24px (1.5rem) maps to text-2xl (1.5rem) in typical design systems. For Tailwind spacing, see p-6, gap-6. Check the use-case table on this page for CSS property examples.
Full converter
PX to REM Converter — any value, custom base
Cheat sheet
PX to REM cheat sheet — 12px through 64px