Back to Code Converter

CSS Unit Converter

Convert between px, rem, em, %, vw, vh and ch units instantly.

Convert units

Enter a value and pick its unit.

% uses the parent font size. ch is approximate (0.5em).

Settings

Set the base values your project uses.

Used for rem (default 16px)

Used for em and %

Sets the viewport width

Used for vw

Used for vh

Common conversions

PXREMEMVWVH
1px0.0625rem0.0625em0.0694vw0.1111vh
2px0.125rem0.125em0.1389vw0.2222vh
4px0.25rem0.25em0.2778vw0.4444vh
8px0.5rem0.5em0.5556vw0.8889vh
10px0.625rem0.625em0.6944vw1.1111vh
12px0.75rem0.75em0.8333vw1.3333vh
14px0.875rem0.875em0.9722vw1.5556vh
16px1rem1em1.1111vw1.7778vh
20px1.25rem1.25em1.3889vw2.2222vh
24px1.5rem1.5em1.6667vw2.6667vh
32px2rem2em2.2222vw3.5556vh
40px2.5rem2.5em2.7778vw4.4444vh
48px3rem3em3.3333vw5.3333vh
56px3.5rem3.5em3.8889vw6.2222vh
64px4rem4em4.4444vw7.1111vh
80px5rem5em5.5556vw8.8889vh
96px6rem6em6.6667vw10.6667vh
128px8rem8em8.8889vw14.2222vh
160px10rem10em11.1111vw17.7778vh
192px12rem12em13.3333vw21.3333vh

Unit reference and formulas

Every value converts through pixels: divide by a unit's base to get there, multiply to come back. With the default 16px root, 24px is 1.5rem and 1.5rem is 24px.

px
Absolute pixels, the base every other unit converts throughpx = rem × root font size
rem
Relative to the root font sizerem = px ÷ root font size
em
Relative to the parent font sizeem = px ÷ parent font size
%
Percentage of the parent font size% = px ÷ parent font size × 100
vw
1% of the viewport widthvw = px ÷ viewport width × 100
vh
1% of the viewport heightvh = px ÷ viewport height × 100
ch
Width of the 0 character, about 0.5emch ≈ px ÷ (parent font size × 0.5)
svw lvw dvw
Small, large and dynamic viewport width; convert like vw
svh lvh dvh
Small, large and dynamic viewport height; convert like vh

FAQ

Divide the pixel value by the root font size. With the default root of 16px, 24px is 1.5rem. Change the root font size above if your project sets the html element to something else.

rem is relative to the root font size set on the html element, so it stays consistent everywhere. em is relative to the parent element's font size, so nested elements can compound. Set the parent font size above to see em and % values for your context.

Webflow's Designer offers px, em, rem, ch, vw, vh and %, plus the small, large and dynamic viewport units svw, lvw, dvw, svh, lvh and dvh. This tool converts the seven main units; the sv, lv and dv variants convert like vw and vh against the viewport size you set.

One ch is the width of the 0 glyph in the current font. Without your actual font, this tool assumes 0.5em, the usual fallback width, so ch values are an estimate. Check them against your real typeface.