CSS Unit Converter

Instantly convert between px, rem, em, vw, vh, %, pt, pc, cm, mm, in, ch, and ex

Common Conversions

FromToValue

Quick Reference — Common Sizes

Features

Two-Way Conversion

Select any unit as input and instantly see conversions to all other CSS units. No mode switching needed.

Custom Viewport & Base

Set your own base font size, viewport width, and viewport height for accurate vw, vh, and rem conversions.

14 CSS Units Supported

px, rem, em, vw, vh, %, pt, pc, cm, mm, in, ch, ex — every common CSS length unit in one place.

One-Click Copy

Click any result to copy the value with its unit straight to your clipboard. Ready to paste into your CSS.

Frequently Asked Questions

How do I convert px to rem?
Divide the pixel value by the base font size (default 16px). For example, 24px ÷ 16 = 1.5rem. This tool calculates it automatically — just enter 24 in the value field, select px, and see the rem result instantly.
What is the difference between em and rem?
rem is always relative to the root element's font size (typically 16px on browsers). em is relative to the current element's font size, which can vary based on nesting. For predictable sizing, prefer rem. For component-level relative sizing, use em.
How are viewport units (vw, vh) calculated?
1vw equals 1% of the viewport width, and 1vh equals 1% of the viewport height. On a 1920px wide screen, 1vw = 19.2px. Set your viewport dimensions above to get accurate conversions for your target device.

Get CSS Tips in Your Inbox

Subscribe for front-end development tips, CSS tricks, and tool updates.

Related Tools