PX to REM Converter

  • Tested against 600 conversions worked with exact fractions in Python
  • Checked by Wayne Bickerton
  • Sources: W3C
  • Updated November 11, 2026

Rem = pixels ÷ the root font size, and with the usual 16px base, 24px is 1.5rem. 1rem equals the font size of the page’s root element, so the answer depends on that base size, and you can change it. Type a size in pixels to get it in rem for your CSS, or switch to turn rem back into pixels.

px
px

In rem
1.5rem Base 16px

24px is 1.5rem when the root font size is 16px.

In em (same base) 1.5em
As a percentage 150%
In points 18pt

How to convert px to rem

Divide the pixels by the root font size (the font size of the html element). To go back, multiply rem by the root font size. em works the same way, but against the font size of the element’s parent instead of the root.

rem = pixels ÷ root font size

Here it is with your numbers:

  1. 24 ÷ 16 = 1.5rem.
  2. As a percentage of the base, that is 1.5 × 100: 150%.
  3. In points (72 to the inch, 96 px to the inch): 24 × 0.75 is 18pt.

It means you can write 24px as 1.5rem, and it grows if the reader makes their text bigger.

Source W3C · CSS Values and Units Level 4, §6.1.1 Font-relative lengths (em, rem) ↗W3C · CSS Values and Units Level 4, §6.2 Absolute lengths ↗

PX to REM chart

At your root font size:

PixelsRem
8px0.5rem
10px0.625rem
12px0.75rem
14px0.875rem
16px1rem
18px1.125rem
20px1.25rem
24px1.5rem
28px1.75rem
32px2rem
36px2.25rem
40px2.5rem
48px3rem
64px4rem

rem or em?

  • rem (root em) is always measured against the root font size, so 1.5rem is the same size everywhere on the page.
  • em is measured against the font size of the element itself, which it inherits from its parent, so ems inside ems multiply: 1.5em inside a 1.5em box is 2.25 times the base.
  • Both grow when the reader makes their browser’s text bigger; pixels set in CSS don’t.

FAQs

How many px is 1 rem?

1rem is the root element’s font size. With a 16px base, 1rem is 16px; with a 20px base it is 20px.

Source W3C · CSS Values and Units Level 4, §6.1.1 Font-relative lengths (em, rem) ↗

What is 1 px in rem?

At a 16px base, 1px is 0.0625rem (1 ÷ 16).

How to change px to rem?

Divide the pixels by the root font size. 24px ÷ 16 is 1.5rem.

Is 1 rem equal to 16px?

Only when the root font size is 16px. rem follows the root font size, so if the site sets html to 20px, or the reader turns up their browser’s text size, 1rem grows with it. That is why rem is used for text.

Sources

Related calculators