Skip to content

How to Use CSS Unit Converter

Convert CSS units: px to rem, em, pt, vw, vh and percent, using your own root font size and viewport. Free online CSS unit converter, copy the value.

About this tool

Convert CSS lengths using explicit font and viewport reference sizes.

How to use CSS Unit Converter

  1. Enter Value and choose its Unit.
  2. Set Root font size, Parent font or size, Viewport width and Viewport height to match your page.
  3. Click a converted value to copy it.

Worked example

With a 16px root font size, 32px corresponds to 2rem.

Are em and rem always the same?

No. rem refers to the root font size; em depends on the applicable font-size context. Enter the correct reference values.

Are percentage conversions universal?

No. CSS percentages depend on the property and containing block. This tool uses the supplied parent reference, so verify it matches your use case.

Put this guide into practice

Explore CSS Tools · More practical guides

Accessibility Menu

Personalize your experience. Open with Ctrl+U (Option+U on Mac). Preferences stay in this browser when storage is available.

Move / Hide Widget

Restore at any time with Ctrl+U (Option+U on Mac).

Accessibility statement and help