
Convert length, weight, temperature, data size, area and speed with decimal and binary units.
Convert px, rem, em and vw using your own root font size and viewport width.
Your files never leave your device. Everything runs in your browser.
CSS lengths are relative more often than not, which is why a value copied from a design file rarely survives the trip to a stylesheet unchanged. CSS Unit Converter translates a value between pixels, root-relative rem, em and viewport-relative vw, using base sizes that you supply.
The tool needs those base sizes because a browser computes them at render time and a calculator cannot see the page. Enter the root font size and the viewport width you are designing against, and the four result rows show the equivalent value in every unit.
One limitation is worth stating plainly. In real CSS, em is relative to the parent element's font size, while rem is relative to the root. This tool has no parent font-size input, so it calculates em against the root font size and its em result only matches a browser when the parent size happens to equal the root size. Use rem for predictable sizing, or evaluate em with the real parent size in mind.
16px is 1rem, 1em and 1.1111vw.24px is always 1.5rem, but it is 1.6667vw at a 1440px viewport and 1.25vw at 1920px.100vw at a 1440px viewport converts to 1440px and 90rem, because 1440 divided by 16 is 90.rem is always relative to the root element's font size, so it stays predictable everywhere. em is relative to the font size of the element's parent, so it compounds with nesting. This tool treats em as if the parent matched the root, which is the one behaviour to watch.
A calculator cannot know your page's computed styles or the device viewport. Supplying both makes the maths explicit and reproducible instead of guessing at common defaults.
Sixteen pixels is the usual browser default, but users can change the default font size and designers often set a different html font size. The tool cannot detect it, so enter the root size your page actually uses.
Each result is rounded to four decimal places. That is enough for typical pixel work; if you need more precision for a design token pipeline, calculate with the formulas directly.
The unit converter just applies the percentage you give it. In a browser, 1vw is one percent of the viewport width including the space reserved for a classic scrollbar, so use the real resolved width when exactness matters.
No. The conversion runs entirely in your browser.
Related convert tools: Unit Converter, Aspect Ratio Calculator, Color Converter.
CSS conversions are calculated in your browser — no values are uploaded.