Tool guide
About this tool.
- Translating a design in px or pt into rem and em.
- Working out how large a vw value is on a given screen.
- Converting print units such as mm, cm and Q to screen pixels.
- Checking what a percentage font size means for a known parent.
Enter a value, pick its unit and set the context: root font size, parent font size and the viewport size.
The output lists the value in every other CSS unit, right-aligned so the numbers are easy to scan.
If you only convert absolute units you can leave the context at its defaults.
Copy the result or download css-units.txt.
- 24px → 1.5rem, 1.5em, 150%, 18pt, 1.5pc, 0.25in, 0.635cm, 6.35mm, 25.4Q
- 24px at 1440 x 900 → 1.6667vw, 2.6667vh, 2.6667vmin, 1.6667vmax
- 1.5rem with root 16 → 24px
- 2em with a 20px parent → 40px
- 210mm → about 793.7px
- 12pt → 16px
- The value must be between -1,000,000 and 1,000,000, with up to 4 decimals.
- Root and parent font sizes are 1 to 100 px with up to 2 decimals; viewport width and height are whole numbers from 1 to 10000 px.
- % means a percentage of the parent font size.
- Results are rounded to four decimals with trailing zeros removed.
- Out-of-range or non-numeric values are rejected, never clamped.
- vmin and vmax use the smaller and larger of width and height.