CSS Unit Converter
Convert px, rem, em, vw, vh and more
π 100% client-side β your data never leaves this pageAbout this tool
Convert between all common CSS units in real time. Enter a value in any unit field and all others update instantly. Customize the root font size (for rem/em calculations) and viewport dimensions (for vw/vh calculations). Includes presets for mobile, tablet, desktop and 4K viewports.
Frequently Asked Questions
What is the difference between rem and em?
rem (root em) is relative to the root element font size (usually 16px by default). em is relative to the font size of the element itself or its parent. rem is more predictable and widely recommended for layout sizing.
What is 1rem in pixels?
By default, 1rem equals 16px (the default browser font size). If you change the root font size with html { font-size: 62.5% }, then 1rem equals 10px, making calculations easier.
How are vw and vh calculated?
1vw equals 1% of the viewport width, and 1vh equals 1% of the viewport height. These values depend on the browser window size, which you can customize in this tool's settings.