CSS Unit Converter
Convert px, rem, em, %, pt, pc, in, cm, mm, vw, vh, vmin, vmax and ch with the root font size, element font size, parent size and viewport you enter.
The value in every CSS unit, a scale table of common pixel sizes in rem, em and pt, and the pixel value the conversion went through.
Example: 24 px with a 16 px root is 1.5 rem, 18 pt, 0.25 in, 6.35 mm and 3 vh of an 800 px tall viewport; 1.5 rem at a 20 px root is 30 px = 1.667 em of an 18 px element.
Absolute by definition,
relative by context.
Which units are fixed, which depend on your page, and why the context fields exist.
Absolute units
CSS defines the absolute units against each other: 1 in = 96 px = 72 pt = 6 pc = 2.54 cm = 25.4 mm. These conversions are exact and need no context. A CSS px is a reference pixel, not a device pixel — on a 2× screen one CSS px covers two device pixels in each direction, and print rendering maps 96 px to an inch.
Relative units
rem is the root element’s font size (16 px in every browser’s default stylesheet, but a page can change it and users can too); em is the element’s own computed font size; % is a share of the parent’s size for the property in question; vw / vh are hundredths of the viewport width and height, vmin / vmax the smaller and larger of the two; ch is the advance width of the digit 0 in the current font. Every conversion goes through pixels: value × (px per unit of the source) ÷ (px per unit of the target), so relative units convert correctly only for the context you enter.
What this does not know
Your page’s real root and element font sizes, the parent’s size, the viewport of the visitor and the font’s 0 width — the initial values are the CSS defaults or round numbers, not measurements. Container query units (cqw …), lh / rlh and the small/large viewport variants are not included. Nothing leaves the browser; the same four anonymous usage counts as the rest of the site apply.
SOURCES
- CSS Values and Units Module Level 4: absolute units 1 in = 96 px = 72 pt = 6 pc = 2.54 cm; rem, em, %, vw/vh/vmin/vmax and ch relative to root font, element font, parent, viewport and the "0" glyph
Last reviewed 21 September 2026. How results are checked: How we verify.