Skip to content
Calcuplay
Tech

px to rem converter

With a 16 px root font size, 24 px = 1.5 rem: divide the pixels by the root size. Change the base if your site sets another font size on html.

Quick challenge

Streak 0Best 0

Test yourself: every answer is computed by the tool, and the wrong choices are the most common traps.

How it works

Formula: rem = px ÷ root font size

In CSS, 1 rem equals the font size of the root element (html), however deeply an element is nested; em refers to the parent instead. So rem = px ÷ root size and px = rem × root size. CSS also fixes 1 px = 1/96 inch and 1 pt = 1/72 inch, so 1 pt = 4/3 px: 12 pt = 16 px. The tool starts at 16 px, the usual default text size of browsers; a visitor who picks larger text in their settings changes it, which is why rem sizes follow their choice.

Worked examples

  • 24 px with a 16 px base

    24 ÷ 16 = 1.5 rem.

  • 24 px with a 10 px base

    24 ÷ 10 = 2.4 rem.

  • 12 pt in pixels

    12 × 4/3 = 16 px.

Common mistakes

  • Dividing by 10 when the base is 16 px: 24 px = 2.4 rem.

    Divide by the real root size: 1.5 rem.

  • Using nested em as if they were rem: 1.5 em inside 1.5 em.

    em values multiply: 16 × 1.5 × 1.5 = 36 px. With rem, 1.5 rem stays 24 px.

  • Treating points as pixels: 12 pt is not 12 px.

    1 pt = 4/3 px: 12 pt = 16 px.

Pixels to rem with a 16 px base

Pixels to rem with a 16 px base
PixelsremPoints
10 px0.625 rem7.5 pt
12 px0.75 rem9 pt
14 px0.875 rem10.5 pt
16 px1 rem12 pt
18 px1.125 rem13.5 pt
20 px1.25 rem15 pt
24 px1.5 rem18 pt
28 px1.75 rem21 pt
32 px2 rem24 pt
40 px2.5 rem30 pt
48 px3 rem36 pt
64 px4 rem48 pt

Frequently asked questions

How many pixels is 1 rem?

As many as the root font size. With 16 px: 1 rem = 16 px, 0.75 rem = 12 px and 2 rem = 32 px.

rem or em?

rem always refers to the font size of html, so 1.5 rem is the same everywhere on the page. em refers to the parent element, so nested em sizes multiply.

Why use rem rather than px?

Sizes in rem follow the text size the visitor chose in their browser settings; font sizes in px ignore that choice, which hurts people who need larger text.

Tech calculators

Tech calculators

Related tools

Other calculators