CSS Unit Converter
Free online CSS unit converter tool, px/rem/em/vw conversion
About CSS Unit Converter
Convert a single length value between nine CSS units systems: px, rem, em, vw, vh, pt, cm, mm, and in. Conversions go through pixels as the common base, using the configurable root font size for rem/em and a configurable viewport size for vw/vh. All eight other units are shown at once in the result grid.
How to Use
1. Enter the value to convert in the numeric input. 2. Choose the source unit from the dropdown next to it. 3. Set Root Font Size (used for rem and em; default 16px). 4. Set Viewport width and height (used for vw and vh; default 1920x1080). 5. Read the equivalent values for every other unit in the result grid.
Conversion Math
Everything is converted to px first, then to the target unit. px is identity. rem and em both multiply/divide by the root font size (em here uses the same root, not a parent font size). vw and vh use (value/100) * viewport dimension. pt uses 96/72, cm uses 96/2.54, mm uses 96/25.4, in uses 96 — all per the CSS spec at 96 CSS pixels per inch. Results use up to 6 decimal places, with 0 shown for extremely small values.
▶Why does em give the same result as rem?
▶Why are my vw/vh values different from my real layout?
▶Does the tool support ch, ex, or q units?
▶Can I convert multiple values at once?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee