2.5 rem to px = 40px
2.5 rem equals 40 pixels at the default root font size of 16px. Adjust the root size below to recalculate.
What’s 2.5rem used for?
2.5rem (40px at default root) is a marketing-headline or hero sub-heading size, and a common large-spacing token. Useful when 2rem feels insufficient for a section heading but 3rem feels too dominant. Often used for landing-page secondary headings.
How it works
To convert 2.5rem to pixels, multiply by the root font size: 2.5 × 16 = 40. The rem unit is relative to the root element’s font size, which browsers default to 16px.
2.5rem at different root sizes
If you’ve overridden the html root font size, the pixel equivalent of 2.5rem shifts. Here’s 2.5rem at common root sizes.
| Root size | 2.5rem in px |
|---|---|
| 16px (default) | 40px |
| 12px | 30px |
| 14px | 35px |
| 18px | 45px |
| 20px | 50px |
| 24px | 60px |
2.5rem in CSS
Use 2.5rem as a hero or page-title font size.
.hero-title {
font-size: 2.5rem; /* 40px */
line-height: 1.1;
letter-spacing: -0.02em;
}FAQ
Is 2.5rem the same as 40px?
Yes, at the browser default root font size of 16px. If the root has been changed (some sites use html { font-size: 62.5% } or similar), the conversion changes — see the table above for 2.5rem at other root sizes.
Why use 2.5rem instead of 40px?
Because 2.5rem scales with the user’s browser font-size preference, and 40px does not. If a user enlarges their default font size for accessibility, anything sized in rem scales proportionately — including this value. Use rem for type and type-adjacent properties; reach for px only when the value must stay fixed regardless of user settings.