CSS Unit Converter (px, rem, em, pt)

Convert between px, rem, em, pt, %, vw, vh, in, cm and mm with your own base font size.

Runs instantly in your browser — results update as you type.

How do I convert px to rem?

To convert pixels to rem, divide the pixel value by the root font size — 16 px by default. So 24px = 1.5rem and 12px = 0.75rem. rem units scale with the user's browser font setting, which helps accessibility.

CSS units at a glance

UnitRelative to
pxCSS pixels (1/96 inch)
remRoot (html) font size
emThe element's (parent's) font size
%The parent value (for font-size: the parent's font size)
vw / vh1 % of the viewport width / height
ptPoints: 1pt = 1.333px (print)

Quick reference (16 px root)

12px = 0.75rem · 14px = 0.875rem · 18px = 1.125rem · 20px = 1.25rem · 32px = 2rem.

Set your own root font size and viewport to match your design. The em result assumes the parent uses the root font size.

Frequently asked questions

Why use rem instead of px?

rem respects the user's preferred font size in the browser, which makes text accessible and layouts scale consistently.

What is the difference between em and rem?

rem is always relative to the root font size; em is relative to the current element's font size and can compound when nested.

How many px is 1pt?

1pt = 1.333px in CSS (96px per inch, 72pt per inch).