Convert px, rem, em, vw, vh, pt and more instantly
Context Settings
| Unit | Value | CSS | |
|---|---|---|---|
| px | 16 | 16px | |
| rem | 1 | 1rem | |
| em | 1 | 1em | |
| % | 1.1111 | 1.1111% | |
| vw | 1.1111 | 1.1111vw | |
| vh | 1.7778 | 1.7778vh | |
| pt | 12 | 12pt | |
| pc | 1 | 1pc | |
| cm | 0.4233 | 0.4233cm | |
| mm | 4.2333 | 4.2333mm | |
| in | 0.1667 | 0.1667in |
Free CSS unit converter. Convert between px, rem, em, %, vw, vh, pt, pc, cm, mm, and in with custom base font size and viewport settings.
16px, which is the browser default. You can change it in the settings to match your project's root font size.
rem is relative to the root (html) font size, while em is relative to the current element's parent font size. rem is generally easier to reason about.
vw and vh are percentages of the viewport width and height respectively. You can set a custom viewport size to match your target device.
Percentage in CSS is relative to the parent element's size. You need to specify the parent's size in px for an accurate conversion.
Only if the root font size is 16px, which is the browser default. If a site sets html { font-size: 18px }, then 1rem equals 18px.
Last updated: January 2025