πŸ“CSS Unit Converter

Convert between px, rem, em and pt

Note: em is shown relative to the base font size. In practice em is relative to the parent element's font size.

About the CSS Unit Converter

CSS Unit Converter converts between px, rem, em and pt based on a configurable root font size, so you can switch units with confidence.

Conversions update live and run locally.

Common use cases

  • Converting a design’s px values to rem for accessibility
  • Translating between em and rem
  • Converting pt values from print specs to px
  • Keeping spacing consistent across a design system

How to use the CSS Unit Converter

  1. Enter a value and its unit.
  2. Set the base (root) font size if different from 16px.
  3. Copy the equivalent in px, rem, em or pt.

Frequently asked questions

What base font size should I use?

Browsers default to 16px, so rem values are relative to 16px unless you change the root font size.

How is pt converted?

CSS treats 1pt as 1/72 inch and 1px as 1/96 inch, so 1pt β‰ˆ 1.333px.

What is the difference between em and rem?

rem is relative to the root font size; em is relative to the element’s own/parent font size.