PX to REM Calculator

Convert CSS pixels to rem and em units for any root font size, with the reverse conversion.

About this tool

rem is relative to the root (html) font size, which browsers default to 16px. So rem = px / root size: 24px / 16 = 1.5rem. Using rem lets layouts scale with the user font-size preference.

FAQ

How many px is 1rem?

By default 16px, unless the root font size has been changed.

rem vs em?

rem is relative to the root element; em is relative to the parent element font size.

Worked example

rem = px / root font size. With the browser default of 16px, 24px = 1.5rem and 14px = 0.875rem. Using rem lets text scale when users change their browser font size, which helps accessibility.

pxrem (16px base)
80.5
120.75
161
201.25
322