PX to EM
& REM converter

Enter a value in any box to convert it. Change the root or parent font size to match your CSS, then copy the result.

EM here is for font-size, which uses the parent’s font size. REM uses the root font size.

Text preview

The quick brown fox jumps over the lazy dog.

24px = 1.5em = 1.5rem

24px ÷ 16px parent = 1.5em

24px ÷ 16px root = 1.5rem

Common sizes

Root: 16px. Parent: 16px.
PixelsEMREM
8px0.5em0.5rem
10px0.625em0.625rem
12px0.75em0.75rem
14px0.875em0.875rem
16px1em1rem
18px1.125em1.125rem
20px1.25em1.25rem
24px1.5em1.5rem
28px1.75em1.75rem
32px2em2rem
36px2.25em2.25rem
40px2.5em2.5rem
48px3em3rem
64px4em4rem
72px4.5em4.5rem
96px6em6rem

How the units work

Pixels and REM

A CSS pixel is a reference unit, so it does not always equal one physical pixel on a screen. Browser zoom changes how large it looks.

REM is relative to the font size on the html element. With a 16px root, 1.5rem is 24px. Change the root to 20px and the same 1.5rem becomes 30px.

REM can keep text and spacing in proportion when the root size changes. A common browser default is 16px, but check the computed styles on the website you’re working on.

EM depends on where you use it

For font-size, EM uses the parent’s computed font size. A heading set to 1.5em inside a 20px parent is 30px, even if the root is still 16px.

For properties such as padding, EM uses the element’s own computed font size. A button with 20px text and padding: 0.5em has 10px of padding.

Nested text can grow at each level when you use EM for font sizes. REM keeps referring to the root. Use the two font-size settings above to compare them.

See MDN’s CSS values and units reference for more examples.