At the default root font size of 16px, 1rem is exactly 16px.
Calculation based on a root font-size of 16 pixels.
How to convert 1rem to px
To convert rem to pixels, multiply the rem value by the root font size: px = rem × 16. For 1rem that is 1 × 16 = 16px.
16px is a medium size, common for body text, subheadings, buttons and standard spacing. It is often used for the default browser font size, which is exactly 1rem.
1rem at different root font sizes
| Root font size | Input | Result |
|---|---|---|
| 10px | 1rem | 10px |
| 12px | 1rem | 12px |
| 14px | 1rem | 14px |
| 15px | 1rem | 15px |
| 16px | 1rem | 16px |
| 18px | 1rem | 18px |
| 20px | 1rem | 20px |
| 22px | 1rem | 22px |
| 24px | 1rem | 24px |
CSS examples
font-size: 1rem; /* 16px */
padding: 1rem;
margin-bottom: 1rem;
width: 1rem;The same values in pixels, if you need a fixed size:
font-size: 16px;
padding: 16px;Tailwind CSS equivalent
The default spacing scale has a step for 1rem: use classes like p-4, m-4, gap-4, w-4 and h-4. As a font size, 1rem is the default text-base class.
Nearby values
Frequently Asked Questions
1rem equals 16px when the root font size is the browser default of 16px. The calculation is 1 × 16 = 16.
16px equals 1rem at a 16px root font size (16 ÷ 16 = 1).
Yes. rem is relative to the root font size, so 1rem becomes 18px at an 18px root and 20px 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.
