CSS Unit Converter

Convert between px, rem, em, vw, vh, and pt. Set your root font size and viewport dimensions to match your project's actual values.

rem
1rem
em
1em
vw
1.1111vw
vh
1.7778vh
pt
12pt
%
100%

rem = relative to root font size · em = relative to parent element font size · vw/vh = 1% of viewport width/height

Frequently Asked Questions

How do I convert px to rem?

Divide the pixel value by the root font size. With a 16px root font size (browser default), 32px = 2rem. Formula: rem = px ÷ root-font-size.

What is the difference between rem and em?

rem is relative to the root (html) font size, which is consistent everywhere. em is relative to the current element's font size, which can cascade and compound unpredictably.

What does 1vw equal in pixels?

1vw equals 1% of the viewport width. On a 1440px wide screen, 1vw = 14.4px. On a 375px mobile screen, 1vw = 3.75px.