PX to REM Converter

Convert pixels to rem and back, with your own root font size.

How it works

Browsers set the root font size at 16 pixels by default and 1 rem equals that size. Divide pixels by the root size to get rem, or multiply rem by it to get pixels. Change the root size if your page sets html { font-size } to something else.

The formula

rem = px / root size

Worked example

24px at a 16px root is 24 / 16 = 1.5rem. 2rem at a 16px root is 32px.

Good to know

Common questions

What is the difference between rem and em?
rem uses the root size. em uses the current element or its parent.
What is 16px in rem?
1rem with the default root size.
Should I use px or rem?
rem for text and layout that should scale, px for hairlines like 1px borders.

More in Utilities.