At the default root font size of 16px, 2.5rem is exactly 40px.
Calculation based on a root font-size of 16 pixels.
How to convert 2.5rem to px
To convert rem to pixels, multiply the rem value by the root font size: px = rem × 16. For 2.5rem that is 2.5 × 16 = 40px.
40px is a large size, common for headings, section padding and generous layout gaps. It is often used for large headings and section padding.
2.5rem at different root font sizes
| Root font size | Input | Result |
|---|---|---|
| 10px | 2.5rem | 25px |
| 12px | 2.5rem | 30px |
| 14px | 2.5rem | 35px |
| 15px | 2.5rem | 37.5px |
| 16px | 2.5rem | 40px |
| 18px | 2.5rem | 45px |
| 20px | 2.5rem | 50px |
| 22px | 2.5rem | 55px |
| 24px | 2.5rem | 60px |
CSS examples
font-size: 2.5rem; /* 40px */
padding: 2.5rem;
margin-bottom: 2.5rem;
width: 2.5rem;The same values in pixels, if you need a fixed size:
font-size: 40px;
padding: 40px;Tailwind CSS equivalent
The default spacing scale has a step for 2.5rem: use classes like p-10, m-10, gap-10, w-10 and h-10.
Nearby values
Frequently Asked Questions
2.5rem equals 40px when the root font size is the browser default of 16px. The calculation is 2.5 × 16 = 40.
40px equals 2.5rem at a 16px root font size (40 ÷ 16 = 2.5).
Yes. rem is relative to the root font size, so 2.5rem becomes 45px at an 18px root and 50px at a 20px root. 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.
