Skip to main content
HandyWeb

CSS Unit Converter

Convert px, rem, em, %, vw, vh, pt, cm, and other CSS units, with your own root font size and viewport size.

Runs on your device.

Context

Absolute units follow the CSS rule: 1in = 96px. These are CSS pixels, not physical screen pixels.

How to Use It

  1. Enter the value and its unit.
  2. If needed, change the context (font and viewport sizes).
  3. Copy the CSS value you need.

Questions and Answers

How many pixels is 1rem?

It depends on the root (html) font size. Browsers use 16px by default, so 24px is 1.5rem.

Good to Know

Relative units (em, %, vw, vh) depend on the context you enter. ch, ex, and container units are not supported.

Source code of this toolReport a problem on GitHub