📏
CSS Unit Converter
Convert between px, rem, em, vw, vh, and %
Base Settings
Convert
Common Conversions (base: 16px)
| Use | px | rem |
|---|---|---|
| Small text | 12px | 0.75rem |
| Body text | 14px | 0.875rem |
| Base | 16px | 1rem |
| Large text | 18px | 1.125rem |
| H4 | 20px | 1.25rem |
| H3 | 24px | 1.5rem |
| H2 | 30px | 1.875rem |
| H1 | 36px | 2.25rem |
| Display | 48px | 3rem |
Unit Reference
px (pixels)
Absolute unit. Fixed size regardless of context.
rem (root em)
Relative to root font-size. Best for responsive typography.
em
Relative to parent element's font-size. Can compound.
vw / vh
Viewport width/height percentage. Great for full-screen layouts.
%
Percentage of parent element. Context-dependent.