CSS Units Converter
Convert a CSS value between px, em, rem, pt, vw, and vh all at once.
About this tool
Convert a CSS length value between pixels, em, rem, points, and viewport units all at once, using your chosen base font size and viewport dimensions.
Key Features
- Converts px, em, rem, pt, vw, and vh simultaneously
- Adjustable base font size for em/rem conversion
- Adjustable viewport size for vw/vh conversion
- Instant results
How to Use
- Enter a value and choose its unit.
- Set your base font size and viewport dimensions if different from the defaults.
- Click Convert.
Benefits
- Translate a design spec between different CSS units
- Understand how a rem value scales at different base font sizes
- Check what a viewport unit equals at a specific screen size
Frequently Asked Questions
em is relative to the font size of its own element (or its parent, depending on the property), so nested elements can compound unexpectedly. rem is always relative to the root html element font size, which stays consistent no matter how deeply nested an element is — this predictability is why rem is generally preferred for most sizing.
vw and vh are defined as a percentage of the viewport width and height respectively, so 1vw literally means a different pixel value on a phone screen versus a large monitor. Entering your target viewport size lets the conversion reflect the actual screen you are designing for.
In CSS specifically, 1pt is fixed at exactly 1/72.05 approximately of the CSS reference pixel, which this tool treats as 1pt = 1.333px, matching how browsers render it — although points are more commonly associated with print, where their physical size can differ slightly by context.