🍋 CSS Tools
CSS Unit Converter
Convert between px, rem, em, %, vw, vh, pt, cm, mm, and in
chars
words
sentences
lines
Results
Result
About CSS Unit Converter
Convert CSS units with configurable base font size and viewport dimensions. Shows all conversions with formulas and CSS usage examples.
Step by Step
- 1 Enter a value with its unit (e.g., 16px, 1.5rem, 100%)
- 2 Adjust base font size and viewport dimensions if needed
- 3 View the conversion table showing all equivalent values
- 4 Copy the unit you need for your CSS
Tips
- Use rem for font sizes and spacing — it scales with the user's browser settings
- 1rem equals the root font size (usually 16px by default)
- Use vw/vh for full-viewport layouts, but add a max-width to prevent overflow
- pt is best for print stylesheets — 1pt = 1/72 inch
Frequently Asked Questions
What is the difference between em and rem?
rem is relative to the root (<html>) font size, always consistent. em is relative to the parent element's font size, which can compound and cause unexpected sizes in nested elements.
When should I use px vs rem?
Use rem for text, spacing, and layout that should scale with user preferences. Use px for borders, shadows, and elements that should stay a fixed size regardless of zoom level.