CSS Unit Converter
Convert between CSS units with configurable base font size and viewport dimensions.
px
16 px
rem
1 rem
em
1 em
vw
0.83333333 vw
vh
1.4814815 vh
pt
12 pt
pc
1 pc
cm
0.42333333 cm
mm
4.2333333 mm
in
0.16666667 in
Examples
| Input | Result |
|---|---|
| 16px | 1rem, 1em, 12pt, 0.4233cm |
| 1.5rem (base: 16px) | 24px, 1.25vw at 1920px viewport |
| 100vw (viewport: 1920px) | 1920px, 120rem, 50.8cm |
| 1in | 96px, 6rem, 72pt, 2.54cm, 25.4mm |
About this tool
Enter a value and a source unit to see it converted to all other CSS units at once. The converter handles screen units (px, rem, em, vw, vh), print units (pt, pc), and physical units (cm, mm, in).
You can adjust the base font size (used for rem/em calculations) and viewport dimensions (used for vw/vh calculations) to match your project settings. This is faster than doing the math by hand every time you need to convert between px and rem or figure out how many vw units a pixel measurement equals.
Frequently asked questions
What CSS units are supported?
px, rem, em, vw, vh, pt (points), pc (picas), cm, mm, and inches. All conversions are based on the CSS specification where 1 inch equals 96 pixels.
How do rem and em differ?
Both are relative to a font size. rem is relative to the root element font size (set by the base font size setting). em is relative to the parent element font size. In this tool, both use the same base font size for conversion since there is no DOM context.
Why do vw and vh need viewport dimensions?
vw and vh are percentage-based viewport units. 1vw equals 1% of the viewport width, so the tool needs to know the viewport dimensions to calculate pixel equivalents. The defaults are 1920x1080.
