Your privacy choices

We use essential storage to remember your settings. With your permission, Google AdSense may use cookies to serve and measure ads. Privacy Policy.

CSS rem to px

Convert rem values to pixels, or pixels back to rem, at any root font size.

Built and maintained by The NumberPrism Editorial TeamEditorial policy

Your details

px

Browsers default to 16 px, but users and CSS can change it.

Results update as you type. The formula and assumptions are explained below the calculator.

Value in pixels

24 px

Pixels24 px
Rem1.5 rem
Root font size16 px
At a 16 px root24 px

One rem equals the root font size, not the element font size. Check the computed font size of the html element when a design does not match a 16 px baseline.

Share calculator

Use this tool

Embed

What does this tool do?

A rem is relative to the root element font size, which is 16 pixels by default in browsers but can be changed by the user or by CSS. This converter keeps the arithmetic straight in both directions.

The Formula

Pixels = rem × root font size; rem = pixels ÷ root font size

Frequently Asked Questions

Should I use rem or px in CSS?

rem scales with the user font-size setting and is generally better for text, spacing and layout. Pixels are still useful for borders, hairlines and fixed media queries.

Why does 1 rem not equal 16 px on my site?

The root font size has been overridden, either by a CSS rule on the html element or by browser accessibility settings. Enter the actual value to get the right conversion.