What is a PX to REM Converter?
px to rem: divide the pixels by the root font size, which is 16px by default. So 12px = 0.75rem, 14px = 0.875rem, 16px = 1rem, 20px = 1.25rem, 24px = 1.5rem and 32px = 2rem. rem to px is the reverse: multiply by 16, so 1.25rem = 20px.
A rem is the root element’s font size. Browsers default that to 16px, so 1rem = 16px, and converting is one division or one multiplication: 24px ÷ 16 = 1.5rem, and 1.25rem × 16 = 20px.
Type into either box and the other one follows, so the converter works in both directions. Change the root font size if your stylesheet sets one, or pick the 10px preset for the 62.5% convention, where 1rem = 10px and 14px is simply 1.4rem.
Design files are specified in pixels and design systems are built in rem because rem follows the reader’s browser font-size setting: someone who raises their default to 20px gets proportionally larger type and spacing, while px values stay fixed.
PX to REM conversion table
Divide the pixel value by the root font size. At the browser default of 16px, 14px is 14 ÷ 16 = 0.875rem. The last column is for a 62.5% root, where 1rem = 10px.
| Pixels | rem (16px root) | rem (10px root) |
|---|---|---|
| 1px | 0.0625rem | 0.1rem |
| 2px | 0.125rem | 0.2rem |
| 3px | 0.1875rem | 0.3rem |
| 4px | 0.25rem | 0.4rem |
| 5px | 0.3125rem | 0.5rem |
| 6px | 0.375rem | 0.6rem |
| 8px | 0.5rem | 0.8rem |
| 10px | 0.625rem | 1rem |
| 12px | 0.75rem | 1.2rem |
| 14px | 0.875rem | 1.4rem |
| 15px | 0.9375rem | 1.5rem |
| 16px | 1rem | 1.6rem |
| 18px | 1.125rem | 1.8rem |
| 20px | 1.25rem | 2rem |
| 22px | 1.375rem | 2.2rem |
| 24px | 1.5rem | 2.4rem |
| 25px | 1.5625rem | 2.5rem |
| 28px | 1.75rem | 2.8rem |
| 30px | 1.875rem | 3rem |
| 32px | 2rem | 3.2rem |
| 36px | 2.25rem | 3.6rem |
| 40px | 2.5rem | 4rem |
| 48px | 3rem | 4.8rem |
| 50px | 3.125rem | 5rem |
| 52px | 3.25rem | 5.2rem |
| 56px | 3.5rem | 5.6rem |
| 60px | 3.75rem | 6rem |
| 64px | 4rem | 6.4rem |
| 72px | 4.5rem | 7.2rem |
| 80px | 5rem | 8rem |
| 96px | 6rem | 9.6rem |
| 100px | 6.25rem | 10rem |
| 120px | 7.5rem | 12rem |
| 150px | 9.375rem | 15rem |
| 200px | 12.5rem | 20rem |
| 240px | 15rem | 24rem |
| 300px | 18.75rem | 30rem |
| 400px | 25rem | 40rem |
| 500px | 31.25rem | 50rem |
| 600px | 37.5rem | 60rem |
REM to PX conversion table
Multiply the rem value by the root font size: 1.25rem × 16 = 20px, and 4rem × 16 = 64px.
| rem | Pixels (16px root) | Pixels (10px root) |
|---|---|---|
| 0.25rem | 4px | 2.5px |
| 0.3rem | 4.8px | 3px |
| 0.375rem | 6px | 3.75px |
| 0.4rem | 6.4px | 4px |
| 0.5rem | 8px | 5px |
| 0.6rem | 9.6px | 6px |
| 0.625rem | 10px | 6.25px |
| 0.7rem | 11.2px | 7px |
| 0.75rem | 12px | 7.5px |
| 0.8rem | 12.8px | 8px |
| 0.85rem | 13.6px | 8.5px |
| 0.875rem | 14px | 8.75px |
| 0.9rem | 14.4px | 9px |
| 0.95rem | 15.2px | 9.5px |
| 1rem | 16px | 10px |
| 1.1rem | 17.6px | 11px |
| 1.125rem | 18px | 11.25px |
| 1.2rem | 19.2px | 12px |
| 1.25rem | 20px | 12.5px |
| 1.3rem | 20.8px | 13px |
| 1.375rem | 22px | 13.75px |
| 1.4rem | 22.4px | 14px |
| 1.5rem | 24px | 15px |
| 1.6rem | 25.6px | 16px |
| 1.7rem | 27.2px | 17px |
| 1.75rem | 28px | 17.5px |
| 1.8rem | 28.8px | 18px |
| 1.9rem | 30.4px | 19px |
| 2rem | 32px | 20px |
| 2.1rem | 33.6px | 21px |
| 2.2rem | 35.2px | 22px |
| 2.25rem | 36px | 22.5px |
| 2.4rem | 38.4px | 24px |
| 2.5rem | 40px | 25px |
| 2.6rem | 41.6px | 26px |
| 2.8rem | 44.8px | 28px |
| 3rem | 48px | 30px |
| 3.2rem | 51.2px | 32px |
| 3.5rem | 56px | 35px |
| 4rem | 64px | 40px |
| 4.5rem | 72px | 45px |
| 5rem | 80px | 50px |
| 6rem | 96px | 60px |
| 7rem | 112px | 70px |
| 8rem | 128px | 80px |
| 9rem | 144px | 90px |
| 10rem | 160px | 100px |
The 62.5% root, and why the base matters
html { font-size: 62.5% } sets the root to 62.5% of the reader’s default, which is 10px when the default is 16px. Every rem value then reads as pixels divided by ten: 14px is 1.4rem, 24px is 2.4rem.
Use a percentage, never html { font-size: 10px }. A pixel value on the root throws away the reader’s font-size setting, which is the whole reason to use rem. With 62.5%, a reader who sets 20px gets a 12.5px root and everything scales with it.
Two side effects to plan for: body text has to be set back to 1.6rem or it renders at 10px, and third-party components sized in rem on the assumption of a 16px root will come out at 62.5% of their intended size.
Common mistakes and edge cases
- rem in media queries ignores your html font-size. @media (min-width: 48rem) is always 768px at the browser default, because media queries use the initial font size, not the one your stylesheet sets.
- em compounds. A 1.2em element inside another 1.2em element is 1.44 times the outer size. rem does not compound, which is why it is the safer default.
- Long decimals are fine. 15px is 0.9375rem; browsers lay out fractional values without trouble, so there is no need to round to two places.
- Keep hairlines in px. A 1px border or divider usually should not grow with the font size.
- Line height is best left unitless (line-height: 1.5), so it scales with whatever font size the element ends up with.
Further reading
Frequently asked questions
How do I convert px to rem?
Divide by the root font size. At the default 16px root, 14px ÷ 16 = 0.875rem and 24px ÷ 16 = 1.5rem.
How do I convert rem to px?
Multiply by the root font size. At 16px, 1.25rem × 16 = 20px and 4rem × 16 = 64px.
Why rem instead of px?
Readers who raise their browser font size get proportionally larger text and spacing with rem; px ignores their preference.
rem vs em?
rem is relative to the root element, so it means the same everywhere. em is relative to the parent’s font size and compounds down the tree. Default to rem.
What is the 62.5% trick?
html { font-size: 62.5% } makes 1rem = 10px at the default browser setting, so 14px is 1.4rem. Reset body text to 1.6rem, or it renders at 10px, and expect third-party components sized for a 16px rem to shrink.
Should borders be rem too?
Hairline borders usually stay px on purpose: you rarely want a 1px border to grow with the font size.