CSS Unit Converter
Convert any CSS unit to any other instantly. Configure root / parent font size, viewport dimensions, container width, and character size to get accurate results. Bulk mode rewrites entire CSS blocks.
Single conversion
Enter a value, pick a source and target unit. Every other unit is computed too — see the grid below.
16px = 1rem (1rem = 16px).
Context settings
Anchor relative units. Settings persist in your browser and apply to every conversion.
Pixels per 1rem.
Pixels per 1em for the current element's parent.
Pixels per 100vw — also feeds vmin / vmax.
Pixels per 100vh — also feeds vmin / vmax.
Pixels per 100% in the enclosing container.
Width of the '0' glyph in the current font (anchors ch).
Height of the 'x' glyph in the current font (anchors ex).
All targets
Equivalents for 16px across every supported CSS unit. Click any card to copy.
Quick reference
Common pixel sizes converted with default settings (16px root, 1280×720 viewport).
| Pixels | rem | em | pt | % | vw | vh | Tailwind hint |
|---|---|---|---|---|---|---|---|
| 1px | 0.063rem | 0.063em | 0.75pt | 0.078% | 0.078vw | 0.139vh | — |
| 8px | 0.5rem | 0.5em | 6pt | 0.625% | 0.625vw | 1.111vh | p-2 / m-2 |
| 16px | 1rem | 1em | 12pt | 1.25% | 1.25vw | 2.222vh | p-4 / m-4 |
| 24px | 1.5rem | 1.5em | 18pt | 1.875% | 1.875vw | 3.333vh | p-6 / m-6 |
| 32px | 2rem | 2em | 24pt | 2.5% | 2.5vw | 4.444vh | p-8 / m-8 |
| 48px | 3rem | 3em | 36pt | 3.75% | 3.75vw | 6.667vh | p-12 / m-12 |
| 64px | 4rem | 4em | 48pt | 5% | 5vw | 8.889vh | p-16 / m-16 |
| 96px | 6rem | 6em | 72pt | 7.5% | 7.5vw | 13.333vh | p-24 / m-24 |
| 128px | 8rem | 8em | 96pt | 10% | 10vw | 17.778vh | p-32 / m-32 |
Tailwind 4 anchors spacing to 0.25rem steps (4px each at the 16px root). Type ramp values map to text-* utilities.