Convert a CSS length across every common unit at once. Enter a value in px, rem, em, %, vw, vh, pt or cm, set the root font size, parent font size and viewport to match your project, and click any result to copy it. It complements the dedicated px-to-rem and Tailwind converters.
| Unit | 1 unit equals |
|---|---|
| rem | Root font size (16px default) |
| em | Parent font size |
| % | Reference length |
| vw / vh | 1% of viewport width / height |
| pt | 1.333px (1/72 in) |
| pc | 16px (12pt) |
| in | 96px |
| cm | 37.795px |
| mm | 3.7795px |
| Tailwind step | 0.25rem (4px) |
rem is relative to the root (html) font size, which is 16px unless your CSS changes it.
em uses the parent element's font size and compounds when nested; rem always uses the root.
From the viewport size, which defaults to your current browser window and can be edited.
Not necessarily. CSS fixes 1in at 96px, so absolute units are exact in print but depend on screen density on displays.
Yes, using Tailwind's default 0.25rem spacing step.
Every value is first turned into CSS pixels, then divided by the pixel size of each target unit: - **rem:** the root font size (16px by default). - **em:** the parent element's font size. - **%:** a reference length you set, such as the containing block's width. - **vw / vh:** 1% of the viewport width or height, defaulting to this browser window. vmin and vmax use the smaller or larger of the two. - **Absolute units:** fixed by the CSS specification: 1in = 96px, 1pt = 1/72in, 1pc = 12pt, 1cm = 96/2.54px, 1mm = 1/10cm. They match real sizes on paper, not necessarily on a screen. - **Tailwind:** its default spacing step of 0.25rem, so p-4 = 1rem. Results are rounded to four decimals. A unit whose context is zero shows a dash instead of dividing by zero.