Formula
px = rem × root font size
At the browser default root size of 16px: 2.5rem = 40px.
The inverse. Useful when you need to know what a rem-based spacing scale actually renders as.
Converter
—
rem to px conversion table
| Value | 10px root | 12px root | 14px root | 16px root | 18px root | 20px root |
|---|---|---|---|---|---|---|
| 0.125rem | 1.25px | 1.5px | 1.75px | 2px | 2.25px | 2.5px |
| 0.25rem | 2.5px | 3px | 3.5px | 4px | 4.5px | 5px |
| 0.375rem | 3.75px | 4.5px | 5.25px | 6px | 6.75px | 7.5px |
| 0.5rem | 5px | 6px | 7px | 8px | 9px | 10px |
| 0.625rem | 6.25px | 7.5px | 8.75px | 10px | 11.25px | 12.5px |
| 0.75rem | 7.5px | 9px | 10.5px | 12px | 13.5px | 15px |
| 0.875rem | 8.75px | 10.5px | 12.25px | 14px | 15.75px | 17.5px |
| 1rem | 10px | 12px | 14px | 16px | 18px | 20px |
| 1.125rem | 11.25px | 13.5px | 15.75px | 18px | 20.25px | 22.5px |
| 1.25rem | 12.5px | 15px | 17.5px | 20px | 22.5px | 25px |
| 1.375rem | 13.75px | 16.5px | 19.25px | 22px | 24.75px | 27.5px |
| 1.5rem | 15px | 18px | 21px | 24px | 27px | 30px |
| 1.75rem | 17.5px | 21px | 24.5px | 28px | 31.5px | 35px |
| 2rem | 20px | 24px | 28px | 32px | 36px | 40px |
| 2.25rem | 22.5px | 27px | 31.5px | 36px | 40.5px | 45px |
| 2.5rem | 25px | 30px | 35px | 40px | 45px | 50px |
| 2.75rem | 27.5px | 33px | 38.5px | 44px | 49.5px | 55px |
| 3rem | 30px | 36px | 42px | 48px | 54px | 60px |
| 3.5rem | 35px | 42px | 49px | 56px | 63px | 70px |
| 4rem | 40px | 48px | 56px | 64px | 72px | 80px |
| 4.5rem | 45px | 54px | 63px | 72px | 81px | 90px |
| 5rem | 50px | 60px | 70px | 80px | 90px | 100px |
| 6rem | 60px | 72px | 84px | 96px | 108px | 120px |
| 7rem | 70px | 84px | 98px | 112px | 126px | 140px |
| 8rem | 80px | 96px | 112px | 128px | 144px | 160px |
| 9rem | 90px | 108px | 126px | 144px | 162px | 180px |
| 10rem | 100px | 120px | 140px | 160px | 180px | 200px |
| 12rem | 120px | 144px | 168px | 192px | 216px | 240px |
| 16rem | 160px | 192px | 224px | 256px | 288px | 320px |
| 20rem | 200px | 240px | 280px | 320px | 360px | 400px |
| 24rem | 240px | 288px | 336px | 384px | 432px | 480px |
Set it up once in CSS
/* 62.5 % makes 1rem = 10px, so 1.6rem = 16px.
Convenient, but it overrides the user's browser preference at the root —
prefer keeping the default and doing the maths. */
html { font-size: 100%; } /* 16px, respects user preference */
:root {
--step-0: 1rem; /* 16px */
--step-1: 1.25rem; /* 20px */
--step-2: 1.5rem; /* 24px */
--step-3: 2rem; /* 32px */
}
/* Fluid type without a converter, using clamp() */
h1 { font-size: clamp(1.75rem, 1.2rem + 2.5vw, 3rem); }
Questions
How do I convert rem to px?
px = rem × root font size. With the browser default root font size of 16px, 2.5rem = 40px.
What if the root font size is not 16px?
Then every value changes proportionally. The table above shows all six common root sizes side by side. Note that the root font size is whatever html computes to — if a user has increased their browser's default text size, the pixel result changes accordingly.
How do I convert px back to rem?
Invert the formula, or use the px to rem converter.
Other conversions
Common rem values
0.125rem2px0.25rem4px0.375rem6px0.5rem8px0.625rem10px0.75rem12px0.875rem14px1rem16px1.125rem18px1.25rem20px1.375rem22px1.5rem24px1.75rem28px2rem32px2.25rem36px2.5rem40px2.75rem44px3rem48px3.5rem56px4rem64px4.5rem72px5rem80px6rem96px7rem112px8rem128px9rem144px10rem160px12rem192px16rem256px20rem320px24rem384px
Conversions follow the CSS Values and Units specification, in which 1in is defined as exactly 96px. Values are computed, not tabulated by hand.