CSS Unit Converter
Enter a value and a unit to see it converted to px, rem, em, vw, vh, pt and the other common CSS units at once. vw and vh depend on the viewport and rem and em depend on font sizes, so set those reference values to match your layout. For rem alone, try the px to rem Converter; for fluid type scales, see the CSS clamp() Calculator.
🔒 Runs in your browser · Your data is never sent to a server
Reference values
rem uses the root font size; em, % and ch use the parent font size; vw, vh, vmin and vmax use the viewport size.
Results
Notes
- ch is the width of the "0" glyph and varies by font. This tool approximates it as 0.5 times the parent font size.
- pt, pc, cm, mm and in use the fixed CSS ratios (1in = 96px = 72pt = 2.54cm). They may not match real printed or physical on-screen sizes.
- vw and vh are based on the viewport including the scrollbar. On mobile browsers with a dynamic address bar you may need svh or dvh instead, which this tool does not cover.
- Results are rounded to 5 decimal places.
Glossary
vw, vh, vmin, vmax
Units equal to 1% of the viewport width or height. vmin is 1% of the smaller dimension and vmax is 1% of the larger one.
rem vs em
rem is relative to the root (html) font-size, while em is relative to the parent's font-size (or the element's own font-size for properties other than font-size).
ch
A unit equal to the width of the "0" glyph in the current font. With monospace fonts it roughly maps to a number of characters.
FAQ
What do I need to set to convert vw or vh to px?
Set the viewport width and height in px. For a 1920px-wide viewport, 1vw is 19.2px. Use the real viewport size from your browser dev tools for accurate results.
Why do rem and em use different reference values?
rem is based on the html element font-size, while em is based on the parent element font-size. This tool lets you set the root and parent font sizes separately.
How accurate is the ch conversion?
ch is the width of the "0" glyph, which differs by font. This tool approximates it as 0.5 times the parent font size, so treat the result as a guide.
Are pt and cm converted according to the CSS spec?
Yes, it uses the fixed CSS ratios: 1in = 96px = 72pt = 2.54cm and 1pc = 16px. The physical size on a real display depends on its DPI, so it may differ.
Share this page
