CSS Unit Converter

Convert between px, rem, em, %, pt, vw, and vh with a customizable base font size.

Processed on your device β€” never uploaded
Pixels (px)

16px

Root Em (rem)

1rem

Em (em)

1em

Points (pt)

12pt

Percent (%)

100%

Viewport Width (vw)

0.8333vw

Viewport Height (vh)

1.4815vh

pxremempt%
8px0.5rem0.5em6pt50%
10px0.625rem0.625em7.5pt62.5%
12px0.75rem0.75em9pt75%
14px0.875rem0.875em10.5pt87.5%
16px1rem1em12pt100%
18px1.125rem1.125em13.5pt112.5%
20px1.25rem1.25em15pt125%
24px1.5rem1.5em18pt150%
28px1.75rem1.75em21pt175%
32px2rem2em24pt200%
36px2.25rem2.25em27pt225%
40px2.5rem2.5em30pt250%
48px3rem3em36pt300%
56px3.5rem3.5em42pt350%
64px4rem4em48pt400%
72px4.5rem4.5em54pt450%
80px5rem5em60pt500%
96px6rem6em72pt600%

Frequently Asked Questions

What is the difference between px and rem in CSS?
px is an absolute unit fixed at 1/96th of an inch, while rem is relative to the root element's font size (typically 16px by default), making rem better for responsive designs.
How do I convert px to rem?
Divide the pixel value by the root font size. With the default 16px base, 24px equals 1.5rem (24 / 16 = 1.5).
What is the difference between em and rem?
em is relative to the font size of its parent element and can compound, while rem is always relative to the root element font size, making rem more predictable.
When should I use vw and vh units?
Use vw (viewport width) and vh (viewport height) for elements that should scale with the browser window size, such as full-screen hero sections or responsive typography.