Overview

CSS rem units are relative to the root font size, which is 16 px by default in browsers. This converts pixels to rem.

Enter the size in pixels and your base font size.

Worked examples

InputsResult
Pixels (px)16Base Font Size (px)1616px is equal to:1 rem (Base: 16px)
Show 3 more examples
Pixels (px)24Base Font Size (px)1624px is equal to:1.5 rem (Base: 16px)
Pixels (px)14Base Font Size (px)1614px is equal to:0.88 rem (Base: 16px)
Pixels (px)30Base Font Size (px)1030px is equal to:3 rem (Base: 10px)

Result (px) by pixels

With the calculator's starting values, the result is 16px is equal to:. The table shows how it changes with the pixels.

Pixels (px)Result (px)
88px is equal to:
1010px is equal to:
1212px is equal to:
1414px is equal to:
16starting value16px is equal to:
1818px is equal to:
2020px is equal to:
2222px is equal to:
2424px is equal to:

Other inputs: Base Font Size: 16 px. Change them in the calculator above for your own numbers.

How it works

Rem = pixels ÷ base font size. Using rem makes layouts scale when users change their browser's text size, which helps accessibility.

The formula

rem = px ÷ base size

Practical tips

  • 16 px is 1 rem at the default 16 px base.
  • 24 px is 1.5 rem, and 12 px is 0.75 rem.
  • If your CSS sets html { font-size: 62.5% }, the base becomes 10 px, so 24 px is 2.4 rem.

Frequently asked questions

What's the difference between rem and em?

Rem is relative to the root element. Em is relative to the parent's font size, so it compounds.

Why use rem instead of px?

It respects users' font size settings.

How do I convert rem back to px?

Multiply by the base size.