Context Settings
px
px
px
px
Convert
Reference Table
| px | rem | em | pt | % | vw | vh |
|---|---|---|---|---|---|---|
| 8px | 0.5rem | 0.5em | 6pt | 50% | 0.4167vw | 0.7407vh |
| 10px | 0.625rem | 0.625em | 7.5pt | 62.5% | 0.5208vw | 0.9259vh |
| 12px | 0.75rem | 0.75em | 9pt | 75% | 0.625vw | 1.1111vh |
| 14px | 0.875rem | 0.875em | 10.5pt | 87.5% | 0.7292vw | 1.2963vh |
| 16px | 1rem | 1em | 12pt | 100% | 0.8333vw | 1.4815vh |
| 18px | 1.125rem | 1.125em | 13.5pt | 112.5% | 0.9375vw | 1.6667vh |
| 20px | 1.25rem | 1.25em | 15pt | 125% | 1.0417vw | 1.8519vh |
| 24px | 1.5rem | 1.5em | 18pt | 150% | 1.25vw | 2.2222vh |
| 32px | 2rem | 2em | 24pt | 200% | 1.6667vw | 2.963vh |
| 48px | 3rem | 3em | 36pt | 300% | 2.5vw | 4.4444vh |
| 64px | 4rem | 4em | 48pt | 400% | 3.3333vw | 5.9259vh |
| 96px | 6rem | 6em | 72pt | 600% | 5vw | 8.8889vh |
CSS Unit Guide
Absolute Units
px — Pixels, the most common absolute unit.
pt — Points (1pt = 1/72 inch), used in print.
cm / mm / in — Physical measurements, rarely used on screen but useful for print stylesheets.
Relative Units
rem — Relative to the root font size (html element).
em — Relative to the parent element's font size.
% — Percentage of the parent's computed value.
Viewport Units
vw — 1% of the viewport width.
vh — 1% of the viewport height.
Useful for full-screen layouts and responsive typography.
Key Formulas
rem = px / base-font-size1in = 96px = 72pt = 2.54cmvw = (px / viewport-width) * 100