CSS Unit Converter
Convert between CSS units — px, rem, em, vw, vh, pt, cm, mm, and in — instantly in your browser. Configure base font size and viewport dimensions.
| Unit | Value |
|---|
Frequently Asked Questions
What is the difference between px, rem, and em?
px (pixels) is an absolute unit that always maps to a fixed number of device pixels. rem (root em) is relative to the font size of the root HTML element — by default 16px in most browsers. em is similar but relative to the font size of the current element's parent, which makes it context-dependent and can compound when nested. For consistent, scalable layouts, rem is generally preferred over em.
When should I use vw and vh?
vw (viewport width) and vh (viewport height) are percentages of the browser viewport dimensions. 1vw equals 1% of the viewport width, and 1vh equals 1% of the viewport height. They are ideal for full-screen sections, responsive typography that scales with window size, and fluid hero sections. Be aware that vh can behave unexpectedly on mobile browsers where the address bar changes the available height.
How are pt, cm, mm, and in related to px?
These are physical units designed for print media. On screen, CSS defines 1 inch as exactly 96px, regardless of the actual display density. From that anchor: 1pt = 96/72 px ≈ 1.333px, 1cm ≈ 37.795px, 1mm ≈ 3.78px. While these units are precise in print, on screen they are relative to the CSS reference pixel, not the physical display.