- Home
- Tools
- Color & Design
- PX to REM Converter
- REM to PX Converter
REM to PX Converter
Type a value in rem and read it in pixels, at the usual root size of 16 px or at your own. A whole stylesheet can be converted in one go.
Browsers start at 16 px.
- em
- 1.5em
- inside an element whose font size is 16 px
- Points
- 18pt
- 1 px is 0.75 pt
- Percent
- 150%
- of the base font size
Convert a whole stylesheet
From rem to pixels
Multiply the rem value by the font size of the root element, the <html> tag:
pixels = rem × root font size
Browsers give the root 16px unless something changes it, so 1.5rem is 1.5 × 16 = 24px and 0.875rem is 14px.
The same rem at three root sizes
| rem | Root of 10px | Root of 16px | Root of 20px |
|---|---|---|---|
| 0.125rem | 1.25px | 2px | 2.5px |
| 0.25rem | 2.5px | 4px | 5px |
| 0.5rem | 5px | 8px | 10px |
| 0.75rem | 7.5px | 12px | 15px |
| 0.875rem | 8.75px | 14px | 17.5px |
| 1rem | 10px | 16px | 20px |
| 1.125rem | 11.25px | 18px | 22.5px |
| 1.25rem | 12.5px | 20px | 25px |
| 1.5rem | 15px | 24px | 30px |
| 2rem | 20px | 32px | 40px |
| 2.5rem | 25px | 40px | 50px |
| 3rem | 30px | 48px | 60px |
| 4rem | 40px | 64px | 80px |
A rem has no fixed size in pixels, and that is the point of the unit. Two things move the root size:
- The stylesheet.
html { font-size: 62.5% }makes the root 10px, a common trick to keep the sums easy.html { font-size: 18px }makes it 18. - The reader. Browsers have a setting for the default font size. Someone who has raised it to 20px sees every rem a quarter larger, which is what they asked for.
A font size on <body> or on a container changes nothing: a rem always looks at the root. That is the difference with em.
Fill in the root size of your own site above the converter. With the 62.5% trick that is 10.
What converting a stylesheet costs
Turning the rem values of a stylesheet into px fixes every size at one root size, and the page then ignores the reader's font-size setting. That is fine for checking a design against a pixel grid, or for passing measurements to someone who works in pixels. It is rarely what should go live.
rem inside media queries
Inside a media query a rem is the browser's own default, 16px unless the reader changed it, whatever the stylesheet says about <html>. @media (min-width: 48rem) therefore switches at 768px, also on a site with a 10px root. The stylesheet converter leaves media queries alone unless you tick the box, and then converts them against 16.
The px to rem converter page goes the other way, and explains when rem is the better unit and what the 62.5% trick costs.