CSS Unit Converter
NewConvert between px, rem, em, pt, vw, vh, and % using a configurable root font size and viewport width.
em is treated as relative to the same root font size as rem for this conversion (real em depends on the parent element's computed font size, which varies per element and can't be known from a single value). vw/vh conversions use the viewport width you enter for both, since actual height may differ — adjust as needed. % is treated relative to the root font size, matching typical base-font-size percentage usage.
Frequently Asked Questions
Why does the tool treat em the same as rem?
A true `em` value is relative to its parent element's computed font size, which can vary from element to element and can't be known from a single standalone value. This tool approximates `em` using the same root font size as `rem` for a useful estimate — for exact `em` conversion, you need to know the specific parent's font size.
How is the pt-to-px ratio determined?
It uses the standard CSS/print conversion of 96 px per inch and 72 pt per inch, giving a fixed ratio of 96/72 (1.333) pixels per point, which is what browsers use when rendering pt-specified sizes.
What does the viewport width field affect?
It only affects vw/vh conversions, which are defined as a percentage of the viewport's width or height respectively. Since vw and vh can differ if your viewport isn't square, the same width value is used for both here — adjust it to your actual viewport height if you need a precise vh conversion.
Why would I convert % to px?
Percentage font sizes are relative to the parent (or root, for html { font-size: 100% }) — converting against your chosen root size gives you a concrete px equivalent, useful when auditing or standardizing a codebase's font-size declarations.
Does this replace a browser DevTools computed-style check?
No — DevTools shows the actual rendered value for a specific element in a specific context. This tool is for quick, portable conversions when you already know (or want to test) a specific root font size or viewport width.