Learn Computer Academy

CSS Units Converter

Convert between every CSS length, angle, time and resolution unit — with a real, configurable font-size, viewport and container context, not a fixed assumption.

CSS Units lesson

Input

One device pixel at 96dpi — the fixed reference every other length ultimately resolves against.

Preview

Rendered at the size your context settings on the right produce — not your real browser window.

16px

All units at once

UnitValue
px16
em1
rem1
%2
ch2
vw1.1111
vh1.7778
vmin1.7778
vmax1.1111
cqw4
cqh5.3333
cqi4
cqb5.3333
cqmin5.3333
cqmax4
pt12
pc1
in0.1667
cm0.4233
mm4.2333
q16.9333

Presets

How this works

Every ratio here is a fixed CSS-spec constant (1in = 96px, 1cm = 96/2.54px, and so on) or pure percentage math against the context values below — exact by spec, the same in every standards-compliant browser. The one exception is ch: the width of the "0" character genuinely depends on the loaded font, so that ratio is measured from a real, live DOM element instead of assumed.

Measured live from this page’s own font — not a guess.

Context

Output

1rem