CSS Units Converter

Convert between CSS units instantly: px, rem, em, vw, vh, pt, cm, mm, in, and more. Set base font size and viewport dimensions for accurate relative unit conversions.

100% client-side. Your data never leaves your browser.

÷base
Viewport settings
Enter a value above to convert between CSS units

Converters & Examples

Related Tools

CSS Units Converter

Convert between any CSS units with accurate, context-aware calculations. Enter a value, pick a source unit, and see the equivalent in all 14 CSS unit types instantly.

Supported Units

UnitTypeDescription
pxAbsolutePixel, the base unit for screen display
ptAbsolutePoint (1pt = 1/72 inch, 1pt ≈ 1.333px)
pcAbsolutePica (1pc = 12pt)
cmAbsoluteCentimeter
mmAbsoluteMillimeter
inAbsoluteInch (1in = 96px)
remRelativeRoot em, relative to root font size
emRelativeEm, relative to parent font size
vwViewport1% of viewport width
vhViewport1% of viewport height
vminViewport1% of smaller viewport dimension
vmaxViewport1% of larger viewport dimension
exFontApproximate x-height (≈ 0.5em)
chFontApproximate character width (≈ 0.6em)

How to Use

  1. Enter a numeric value in the input field
  2. Select the source unit from the dropdown
  3. See the converted value in every other unit
  4. Adjust base font size or viewport dimensions in Context Settings for accurate relative conversions
  5. Click the copy icon next to any result to copy it

Common Use Cases

Responsive Design with rem

When building responsive layouts, converting between px and rem ensures your spacing scales correctly with user preferences. The default base font size is 16px, matching most browsers.

Media Query Viewport Units

Convert pixel breakpoints to viewport units for fluid responsive designs. A 1440px container equals 100vw at that viewport width.

Cross-Browser Font Sizing

Different browsers have different default font sizes. Using rem instead of px ensures consistent rendering even when users adjust their browser settings.

Converting screen units (px) to print units (pt, cm, in) helps create accurate print stylesheets.