CSS

CSS Unit Converter

Convert px, rem, em, vw, vh and more

πŸ”’ 100% client-side β€” your data never leaves this page
px
px
px
Presets
pxPixels
px
remRoot EM
rem
emElement EM
em
vwViewport Width %
vw
vhViewport Height %
vh
ptPoints
pt
%Percent (of root)
%
cmCentimeters
cm
mmMillimeters
mm
inInches
in

About this tool

Convert between all common CSS units in real time. Enter a value in any unit field and all others update instantly. Customize the root font size (for rem/em calculations) and viewport dimensions (for vw/vh calculations). Includes presets for mobile, tablet, desktop and 4K viewports.

Frequently Asked Questions

What is the difference between rem and em?

rem (root em) is relative to the root element font size (usually 16px by default). em is relative to the font size of the element itself or its parent. rem is more predictable and widely recommended for layout sizing.

What is 1rem in pixels?

By default, 1rem equals 16px (the default browser font size). If you change the root font size with html { font-size: 62.5% }, then 1rem equals 10px, making calculations easier.

How are vw and vh calculated?

1vw equals 1% of the viewport width, and 1vh equals 1% of the viewport height. These values depend on the browser window size, which you can customize in this tool's settings.