CSS Unit Converter (PX/EM/REM/%)
Convert between CSS units: pixels, em, rem, and percentages with configurable base font sizes.
Common Conversions (16px base)
| Pixels | Em/Rem | Percent | Use Case |
|---|---|---|---|
| 10px | 0.625 | 62.5% | Small text |
| 12px | 0.75 | 75% | Captions |
| 14px | 0.875 | 87.5% | Body small |
| 16px | 1 | 100% | Body text |
| 18px | 1.125 | 112.5% | Large text |
| 20px | 1.25 | 125% | H4 |
| 24px | 1.5 | 150% | H3 |
| 32px | 2 | 200% | H2 |
| 48px | 3 | 300% | H1 |
When to Use Each Unit
- px: Fixed sizes, borders, shadows
- em: Relative to parent font-size (good for component spacing)
- rem: Relative to root font-size (consistent across the page)
- %: Relative sizing, widths, and font-sizes
How to Use CSS Unit Converter (PX/EM/REM/%)
- Set your base font size (default 16px)
- Enter a value in any unit field
- All other units update automatically
- Reference the conversion table
About CSS Unit Converter (PX/EM/REM/%)
Modern CSS favors relative units (em, rem, %) over fixed pixels for accessibility and responsive design. Our converter translates between these units, helping you build flexible, scalable stylesheets.
Unit Relationships
- Pixels (px): Fixed unit; 1px = 1 device pixel (roughly)
- Em: Relative to parent element's font size
- Rem: Relative to root (html) element's font size
- Percentage: Relative to parent for most properties
Why Use Relative Units
Users who adjust browser font sizes need relative units to scale proportionally. Fixed pixel sizes ignore these preferences, creating accessibility barriers. Rem-based typography scales consistently across components. Em-based spacing maintains proportions when components resize.
Conversion Math
With a 16px base font (browser default): 24px = 1.5rem = 1.5em (at root level). Our calculator handles custom base sizes—if your root is 18px, conversions adjust accordingly. Understanding these ratios improves CSS architecture decisions.