DevToolPal
EN

CSS units

px to rem Converter

Convert pixels (px) to rem (rem). 1 px = 0.0625 rem, and 1 rem = 16 px.

Formula

rem = px ÷ 16

How to convert

To convert pixels to rem, divide the value by 16. For example, 32 px = 2 rem.

Conversion table

px rem
1 px 0.0625 rem
2 px 0.125 rem
4 px 0.25 rem
8 px 0.5 rem
10 px 0.625 rem
12 px 0.75 rem
14 px 0.875 rem
16 px 1 rem
18 px 1.125 rem
20 px 1.25 rem
24 px 1.5 rem
32 px 2 rem
48 px 3 rem
64 px 4 rem

The table assumes a base font size of 16px. Change the settings in the converter above to match your project.

About these units

Browsers turn every CSS length into pixels. rem is relative to the root font size and em to the parent element's font size; both are 16px in every major browser unless the page or the user changes it. 1pt is 1/72 inch and 1px is 1/96 inch, so 1pt = 1.333px. vw is 1% of the viewport width, so its pixel size depends on the screen.

FAQ

› How do I convert px to rem?

1 px = 0.0625 rem. To convert, divide the value by 16: 32 px = 2 rem.

› What is 1 rem in px?

1 rem = 16 px. The reverse formula is px = rem × 16.

› Why use rem instead of px?

rem sizes follow the user's browser font size setting, which helps accessibility, and changing one root value resizes the whole layout consistently.

› What is the difference between rem and em?

rem always uses the root (html) font size. em uses the font size of the element's parent, so nested em values compound.