What Is a Unit Converter?
This unit converter handles six CSS units: px, rem, em, pt, vw and vh. Understanding the relationships between these units is essential for responsive design, accessible typography, and consistent spacing systems.
CSS Unit Guide
px — fixed, absolute pixels. rem — relative to root font size (default 16px). em — relative to parent's font size (compounds in nested elements). vw/vh — percentage of viewport width/height. % — percentage of parent element. pt — points (1pt = 1/72 inch), used in print. Use our PX to REM converter for bulk CSS conversions.
How to Use This Unit Converter
- Enter a value — Type the number you want to convert in the input field.
- Select the source unit — Choose the unit you're converting from: px, rem, em, pt, vw or vh.
- Select the target unit — The value is shown in all six units at once, ready to copy.
- Set the base font size — For rem and em conversions, specify the root font size (typically 16px) to ensure accurate results.
Worked example: four sizes at the default settings
The converter turns the value into px, then into each of six units: px, rem, em, pt, vw and vh. Its defaults are a 16 px base font, a 1440 × 900 viewport, and 1 pt = 96/72 px, the CSS definition. The last column uses a 375 px phone width instead.
| Input | rem / em | pt | vw (1440) | vh (900) | vw (375 phone) |
|---|---|---|---|---|---|
| 12 px | 0.75 | 9 | 0.8333 | 1.3333 | 3.2 |
| 16 px | 1 | 12 | 1.1111 | 1.7778 | 4.2667 |
| 24 px | 1.5 | 18 | 1.6667 | 2.6667 | 6.4 |
| 48 px | 3 | 36 | 3.3333 | 5.3333 | 12.8 |
- vw depends entirely on the viewport you enter. 16 px is 1.11vw on a 1440 px desktop and 4.27vw on a 375 px phone, so a heading set to 4vw is 57.6 px on the desktop and 15 px on the phone. That is why fluid type is usually
clamp(min, preferred vw, max)rather than vw alone. - em is calculated like rem. The tool uses the base font size for both. In a real page em is relative to the element's own (or, for font-size, its parent's) font size, so 1.5em inside a 20 px parent is 30 px, not 24. Set the base field to the parent's size when converting em.
- Use dvh or svh for full-screen mobile sections. 100vh on a phone is the height with the browser toolbars hidden, so content sits behind them while they show. The small, large and dynamic viewport units (svh, lvh, dvh) fix that and work in Chrome 108, Safari 15.4 and Firefox 101 onward per MDN; the converter treats them as vh at the height you enter.
- Physical units are nominal on screens. CSS fixes 1in at 96 px and 1pt at 1/72 in, so 16 px is 12 pt and 4.23 mm by definition. A phone or monitor does not show those as real millimetres; they are exact only in print.
Sources
Checked on .
Frequently Asked Questions
📖 Learn More
Related Article The Complete Guide to CSS Units → Related Article How to Convert CSS Units →Built by Derek Giordano · Part of Ultimate Design Tools