CSS Unit Converter

Default is 16px. Change this to match your root font size.

Conversions

rem

1.0000rem

px

16.00px

em

1.0000em

pt

12.00pt

vh

vw

cm

0.4233cm

mm

4.2334mm

in

0.1667in

ℹ️ vh and vw are viewport-based and cannot be converted to absolute units. All conversions assume a viewport of 1920×1080.

FAQ

What is REM in CSS?

REM (root em) is a relative unit based on the root font size. By default, 1rem = 16px, but this can be customized on the html element.

How do I convert rem to pixels?

Multiply the rem value by the base font size (default 16px). For example: 2rem × 16px = 32px.

What's the difference between REM and EM?

REM is relative to the root font size, while EM is relative to the parent element's font size. This makes REM more predictable and consistent.

What is CSS Unit Conversion?

article.cssUnitConverter.intro

Different units serve different purposes: px for fixed sizes, rem for scalable typography, em for relative spacing, and vh/vw for viewport-relative dimensions. Understanding these conversions ensures design consistency and accessibility.

Common Use Cases

  • Converting a pixel design mockup to rem-based units for better accessibility and responsiveness across different screen sizes.
  • Calculating font sizes and line heights when switching from a 16px to 18px root font size.
  • Converting point sizes from print designs (pt) to web units (px/rem) when adapting print materials for the web.
  • Working with viewport units (vh/vw) to create fluid layouts that scale with screen dimensions.

How CSS Unit Conversion Works

The converter takes your input value and unit, then calculates equivalent values across all supported CSS units. It uses standard conversion factors: 1rem = base font size (default 16px), 1em = parent font size, 1pt = 4/3px, 1cm = 37.795px, and 1in = 96px. You can adjust the base REM size to match your project's root font size.

Privacy & Security

All CSS unit conversions are performed entirely in your browser. No values are sent to external servers, ensuring your design specifications and calculations remain private.