CSS Unit Converter
Convert a CSS length between common units using explicit font and viewport context.
Calculation stays in this browser.
A QUICK WALKTHROUGH
How to use this tool
- Enter a finite length.
- Choose the source and target CSS units.
- Set root, parent, and viewport context when relative units are involved.
Explicit context
Absolute units use the CSS 96 dpi reference. rem uses the entered root font size, em uses the entered parent font size, and viewport units use the entered viewport width and height. ch and ex are practical font-metric estimates.
Context-dependent units
Percentages and container/query units are excluded because their reference box depends on the surrounding stylesheet and layout.
Local calculation
The value is converted in your browser and is not uploaded or stored.
GOOD TO KNOW
Common questions
Which units are supported?
px, rem, em, vw, vh, vmin, vmax, ch, ex, cm, mm, in, pt, pc, and Q.
Are relative units exact?
No. rem, em, and viewport units use the context you enter; ch and ex are practical font-metric estimates.
Why are percentages excluded?
A percentage length needs a property-specific reference size, so one universal conversion would be misleading.