A free px to rem converter and rem to px calculator. Type a pixel value, set your root font size, and copy the rem value straight into your CSS. Need rem to px instead? Switch the converter to REM to PX, or use the tables below.
Quick answer: 1rem = 16px when the root (html) font size is 16px, which is the browser default. If a site sets the root to 10px, 1rem is 10px.
The formula: rem = px ÷ root font size, and px = rem × root font size. So 24px ÷ 16 = 1.5rem, and 1.25rem × 16 = 20px. The converter below does both directions for any root size, and you can copy the result straight into your CSS.
rem vs em: rem always follows the root font size, so 1.5rem is the same size everywhere on the page. em follows the parent element, so it compounds when you nest elements. Need em values instead? Use my PX to EM converter.
PX to REM Converter
formula: px ÷ root font size = rem
16px ÷ 16px = 1rem
Agencies: I take WordPress overflow work. See white label support
Browsers start with a 16px root font size, so these are the values I reach for most. Each one is px ÷ 16.
| Pixels | REM |
|---|---|
| 8px | 0.5rem |
| 10px | 0.625rem |
| 12px | 0.75rem |
| 14px | 0.875rem |
| 16px | 1rem |
| 18px | 1.125rem |
| 20px | 1.25rem |
| 24px | 1.5rem |
| 28px | 1.75rem |
| 32px | 2rem |
| 36px | 2.25rem |
| 40px | 2.5rem |
| 48px | 3rem |
| 56px | 3.5rem |
| 64px | 4rem |
| 72px | 4.5rem |
Going the other way, multiply by the root: rem × 16 = px.
| REM | Pixels |
|---|---|
| 0.25rem | 4px |
| 0.5rem | 8px |
| 0.625rem | 10px |
| 0.75rem | 12px |
| 0.875rem | 14px |
| 1rem | 16px |
| 1.125rem | 18px |
| 1.25rem | 20px |
| 1.5rem | 24px |
| 1.75rem | 28px |
| 2rem | 32px |
| 2.5rem | 40px |
| 3rem | 48px |
| 4rem | 64px |
| 5rem | 80px |
| PX | Root 10px | Root 12px | Root 14px | Root 18px | Root 20px |
|---|---|---|---|---|---|
| 12px | 1.2rem | 1rem | 0.857rem | 0.667rem | 0.6rem |
| 14px | 1.4rem | 1.167rem | 1rem | 0.778rem | 0.7rem |
| 16px | 1.6rem | 1.333rem | 1.143rem | 0.889rem | 0.8rem |
| 18px | 1.8rem | 1.5rem | 1.286rem | 1rem | 0.9rem |
| 24px | 2.4rem | 2rem | 1.714rem | 1.333rem | 1.2rem |
| 32px | 3.2rem | 2.667rem | 2.286rem | 1.778rem | 1.6rem |
FAQ
At the default browser font size, 1rem is 16px. Rem follows the root (html) font size only, so if a site sets the html element to 18px, 1rem is 18px everywhere on the page.
Multiply the rem value by the root font size. 1.25rem at a 16px root is 1.25 × 16 = 20px. At an 18px root, the same 1.25rem is 22.5px.
Divide the pixel value by the root font size. 24px ÷ 16px = 1.5rem. The converter above does this for any root size, and the table covers the common sizes.
Rem is relative to the root (html) font size, so it is the same size wherever you use it. Em is relative to the font size of the parent element, so it compounds when you nest elements. I use rem for most font sizes and em for spacing that should grow with its own text, like button padding.
Use 16px unless your site changes the font size of the html element. You can check it in your browser’s dev tools. If the html font size is 62.5%, the root is 10px, so set the root to 10 in the converter.
Setting html { font-size: 62.5%; } makes the root 10px at the browser default, so 1rem = 10px and 24px = 2.4rem. The maths gets easy, but you then have to size body text back up, for example 1.6rem for 16px text.
Rem scales with the visitor’s browser font setting. If someone sets a bigger default text size, rem sizes grow with it and px sizes don’t. That makes your site easier to read for more people.
Yes. Every current browser supports rem, including Chrome, Safari, Firefox and Edge on desktop and mobile.
I build and look after WordPress sites every month: updates, backups, speed and small CSS fixes like this one. Plans start at $169 USD a month.
Want to check your site’s speed first? Get my free website check