CSS Unit Converter

Convert between pixels, rem, em, vh, vw, and more.

Standard Device Units

Relative to HTML Root

Relative to Parent

8px0.5rem
12px0.75rem
14px0.875rem
16px1rem
20px1.25rem
24px1.5rem
32px2rem
48px3rem
64px4rem
Settings
PX

Configure the base size and viewport dimensions for accurate relative unit calculations.

  • PX: Fixed size units.
  • REM: Responsive units based on the root font size.
  • EM: Relative to the current element's font size.

About this Tool

In CSS, units can be absolute or relative. Absolute units like pixels (px) are fixed and appear the same size regardless of other settings. Relative units like rem and em are flexible and change based on font sizes or viewport dimensions. Using relative units is a best practice for creating responsive and accessible layouts that adapt to different devices and user preferences.

Frequently Asked Questions