CSS Unit Converter
Free online CSS unit converter tool, px/rem/em/vw conversion
CSS Unit Types
px (pixels) — absolute unit, 1px = 1/96th of an inch. rem — relative to root font size (default 16px). em — relative to parent font size. vw — 1% of viewport width. vh — 1% of viewport height. pt — points (1pt = 1.333px). cm, mm, in — physical units.
How to Convert CSS Units
Enter a value with its unit, set the root font size (for rem calculations) and viewport dimensions (for vw/vh). The tool shows conversions to all other units. This helps ensure responsive designs work across different screen sizes.
▶Should I use px or rem?
Use rem for font sizes and spacing to support user accessibility settings (browser zoom). Use px for borders, box shadows, and fine details where precise control matters. Many teams adopt a rem-first approach for better accessibility.
▶What is the default root font size?
The default root font size in most browsers is 16px. So 1rem = 16px, 1.5rem = 24px. You can change this with html { font-size: ... } in CSS.
▶When should I use vw and vh?
Use vw/vh for responsive layouts that scale with the viewport. Hero sections that fill the entire screen (100vh), font sizes that scale with viewport width, and full-width elements are common use cases.