Px to Rem Converter

This px to rem converter turns pixels into rem (and back): enter a value, adjust the base size, and get rem, em, pt, percent and vw plus a table of common sizes.

Example: Value 24 · Unit of the value: px (pixels) · Root element font size (rem) 16 px · Parent element font size (em, %) 16 px · Viewport width (vw) 1,440 px → Result: 24 px = 1.5 rem. Source: W3C – CSS Values and Units Module Level 4: absolute lengths (1in = 96px = 72pt) and font-relative lengths (em, rem). Updated: .

px
browser default: 16 px
px
usually the same as the root size
px
e.g. 1440 for desktop, 390 for phone
My ToolboxYour inputs are saved in this browser only.

Result

Result
24 px = 1.5 rem
All units
UnitValueCSS
Pixels (px)24 px24px
rem (root font)1.5 rem1.5rem
em (parent font)1.5 em1.5em
Points (pt)18 pt18pt
Percent (%)150 %150%
vw (viewport width)1.6667 vw1.6667vw
Common font sizes
pxremempt
100.6250.6257.5
120.750.759
140.8750.87510.5
150.93750.937511.25
161112
181.1251.12513.5
201.251.2515
221.3751.37516.5
241.51.518
281.751.7521
322224
362.252.2527
402.52.530
483336
563.53.542
644448
724.54.554
966672
Calculated with a root font of 16 px and a parent font of 16 px. rem follows the font size users set in their browser; px stays fixed.

How it is calculated

With the browser default of 16 px, 24 px is exactly 1.5 rem. The formula is rem = px / base size, and the other way round px = rem · base size.

How it is calculated

rem is relative to the font size of the root element (html), em to the font of the parent element. 1 pt is 1/72 inch and 1 px 1/96 inch, so 1 pt = 4/3 px; 12 pt equal 16 px. Percent for font size refers to the parent font. 1 vw is 1% of the viewport width. The converter first turns your value into px and from there into every other unit.

Good to know

Frequently asked questions

How do you convert px to rem?

Divide the px value by the base font size. At 16 px: 24 px / 16 = 1.5 rem.

How many px is 1 rem?

By default 16 px, because browsers preset the root font size to that. If someone changes the browser font or sets font-size on html, the value changes.

What is the difference between em and rem?

rem always refers to the root font (html), em to the font of the parent element. That is why em values can multiply in nested elements.

How many pt is 16 px?

12 pt, because 1 pt = 4/3 px. Conversely 10 pt is about 13.33 px.

Sources and legal basis

As of: · Editorial policy

Related tools