At the default root font size of 16px, 40rem is exactly 640px.
Calculation based on a root font-size of 16 pixels.
How to convert 40rem to px
To convert rem to pixels, multiply the rem value by the root font size: px = rem × 16. For 40rem that is 40 × 16 = 640px.
640px is a very large size, typically used for hero headings, containers and big layout dimensions.
40rem at different root font sizes
| Root font size | Input | Result |
|---|---|---|
| 10px | 40rem | 400px |
| 12px | 40rem | 480px |
| 14px | 40rem | 560px |
| 15px | 40rem | 600px |
| 16px | 40rem | 640px |
| 18px | 40rem | 720px |
| 20px | 40rem | 800px |
| 22px | 40rem | 880px |
| 24px | 40rem | 960px |
CSS examples
font-size: 40rem; /* 640px */
padding: 40rem;
margin-bottom: 40rem;
width: 40rem;The same values in pixels, if you need a fixed size:
font-size: 640px;
padding: 640px;Tailwind CSS equivalent
40rem is not part of the default Tailwind scale, but you can use an arbitrary value such as p-[40rem] or text-[40rem].
Nearby values
Frequently Asked Questions
40rem equals 640px when the root font size is the browser default of 16px. The calculation is 40 × 16 = 640.
640px equals 40rem at a 16px root font size (640 ÷ 16 = 40).
Yes. rem is relative to the root font size, so 40rem becomes 720px at an 18px root and 800px 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.
