CSS Unit Converter
Convert between all CSS units instantly with custom base font and viewport.
① Select source and target CSS units ② Enter a value to convert ③ Copy the result
→
Settings
Base Font
Default 16px — affects rem, em, ex, ch conversions
Viewport
Default 1440×900 — affects vw, vh, vmin, vmax
13 Units
px, rem, em, vw, vh, vmin, vmax, pt, pc, ex, ch, cm, mm, in
CSS Unit Converter — All Units Explained
CSS uses multiple units for sizing: absolute (px, pt, cm, mm, in) and relative (rem, em, vw, vh, %). Relative units depend on context — rem uses the root font size, em uses the parent font size, and viewport units (vw, vh) depend on browser window dimensions. This tool lets you configure base font size and viewport to get accurate results.
Frequently Asked Questions
px is an absolute unit. rem is relative to the root font size (usually 16px). em is relative to the parent element font size. rem is preferred for scalable, accessible typography.
vw (viewport width) is 1% of the browser window width. vh (viewport height) is 1% of the window height. They are used for fluid layouts and full-screen sections.
Browsers default to 16px for the root font size. 1rem = 16px. You can change this in the settings panel to match your project configuration.
pt (point) and pc (pica) are print-based absolute units. 1pt = 1/72 inch = 1.333px. 1pc = 12pt = 16px. They are rarely used in web CSS.
Use rem for font sizes, padding, and spacing to respect user font preferences and enable accessible scaling. Use px for borders, shadows and fine details where absolute precision matters.
ex is the x-height of the current font (roughly half the font size). ch is the width of the "0" character. Both are font-relative and rarely needed outside typography work.
vmin is 1% of the smaller viewport dimension (width or height). vmax is 1% of the larger one. Useful for scaling elements consistently across orientations.