Skip to main content

PX to REM

Convert pixels to rem and back against any root font size.

Convert

Direction
The html element's font-size. Browsers default to 16px.
Result
1rem

Quick reference

PixelsREM
0.5rem
0.625rem
0.6875rem
0.75rem
0.8125rem
0.875rem
0.9375rem
1rem
1.125rem
1.25rem
1.5rem
1.75rem
2rem
2.25rem
2.5rem
3rem
3.5rem
4rem
4.5rem
5rem
6rem

Runs in your browser; nothing you enter leaves this page.

How it works

One division

A rem is the font size of the page's root element. Divide pixels by that size to get rem, multiply rem by it to get pixels. Browsers set the root to 16px unless the user or your stylesheet changes it.

Results keep at most four decimals with trailing zeros dropped, so 24px at a 16px root reads 1.5rem and 11px reads 0.6875rem.

rem = px ÷ root size; px = rem × root size

Switching direction

Switching between PX → REM and REM → PX carries the current result into the field, so the pair on screen stays the same. The up and down keys step by 1px or by a quarter rem.

The sample and the table

The sample sets the letters at the converted pixel size over a ruled grid, one line per rem (spaced at least 4px apart for tiny roots). The table lists common pixel sizes at your root; pick a row to load it.

More tools

All 238 tools