CSS Unit Converter

Convert between CSS units: px, rem, em, vw, vh, pt, cm, mm with custom root font size and viewport.

Tools run in your browser. Shared links may include your input; check the URL before sharing.

How to use

  1. Enter a value and select its unit.
  2. Match the conversion settings to your page.

This example illustrates one supported operation. Choose the matching mode and settings above; generated values and formatting may vary.

Example input or settings

32 px
root font-size: 16 px

Example result

2 rem

How do rem and em differ?

rem uses the root font size. The em reference depends on the property and element font size.