Web Tools

CSS Unit Converter

Convert values between pixels, rem and em with a configurable base font size.

CSS value

Converted value

What this tool does

Relative CSS units make interfaces easier to scale, but conversions depend on a base font size. This tool shows the calculation and the final value.

How to use it well

Start with a small sample, check the output, then paste the full text when the result looks right. For important production data, review the output before saving or sharing it.

Common uses

  • Convert design measurements
  • Move from px to rem
  • Check typography and spacing values
Guide

PX, REM and EM: Choosing CSS Units That Scale

Understand the difference between fixed and relative CSS units before converting design values.

Read guide

Questions

What base size should I use?

Browsers commonly use 16px, but your root or parent font size may be different. Enter the value used by your project.

Are rem and em always identical?

No. Rem uses the root font size, while em uses the current element context. This calculator uses the entered base for either relative unit.