PX to REM converter

Pixels to rem and back.

Convert

24px in rem

1.5rem

24 ÷ 16 = 1.5

rem
Pixels
em (when the parent uses the root size)
Points
Percent of the root size
Pixelsrem (base 16px)Points
1px0.0625rem0.75pt
2px0.125rem1.5pt
4px0.25rem3pt
8px0.5rem6pt
10px0.625rem7.5pt
12px0.75rem9pt
14px0.875rem10.5pt
15px0.9375rem11.25pt
16px1rem12pt
18px1.125rem13.5pt
20px1.25rem15pt
24px1.5rem18pt
28px1.75rem21pt
32px2rem24pt
36px2.25rem27pt
40px2.5rem30pt
48px3rem36pt
56px3.5rem42pt
64px4rem48pt
72px4.5rem54pt
80px5rem60pt
96px6rem72pt

Runs in your browser. Nothing uploaded.

How to convert px to rem

  1. Choose px to rem or rem to px.
  2. Type the Value. Leave Root font size at 16 unless your site sets a different size on the html element.
  3. Read the result, click any value to copy it, and use the table for the other common sizes.

Points and percentages

The result also shows points, the unit used for print and in many design apps. In CSS, 1pt is exactly 4/3 of a pixel, so 12pt = 16px and a pixel is 0.75pt. The percentage is the size as a share of the root font size, the way font sizes are sometimes written on the html element: 1.5rem is 150%.

Converting a whole stylesheet

To move a design from px to rem, start with font sizes, then line heights that use units, then spacing such as margins and padding. Keep borders and very small values, like a 1px hairline, in px, because they should stay crisp whatever the text size. Media queries can use em or rem as well; most browsers treat both as relative to the browser’s default size there, not the root element’s CSS size.