Skip to content
Units

px to em converter

em = px / parent

18px at an 18px parent is 1em. The same 18px at a 16px parent is 1.125em. 16px inside a 32px heading is 0.5em.

Nested em multiplies, so a child of 1.2em is not 1.2 times the root when an ancestor is already in em. This page uses the parent field. Rem on the same card still uses the root.

Convert

Edit any field. Rem uses the root font size. Em uses the parent font size.

Base sizes

Used for rem. Browsers start at 16.

Used for em. Matches rem while this equals the root.

Copies the pixels field.

Common sizes

16 px, 1 rem, 1 em

px in em at a 16px parent and an 18px parent
pxem (parent 16px)em (parent 18px)
80.50.4444
100.6250.5556
120.750.6667
140.8750.7778
1610.8889
181.1251
201.251.1111
241.51.3333
3221.7778

Also see px to rem, rem to px, and em to px. The other unit groups are on Units.

Questions

How do you convert px to em?

Divide px by the parent font size. em = px / parent. 18px at an 18px parent is 1em. At a 16px parent, 18px is 1.125em.

Why isn’t 16px always 1em?

1em equals the parent font size, which is not always 16. 16px inside a 32px heading is 0.5em.

Do nested em values add?

They multiply. A child of 1.2em is not 1.2 times the root when an ancestor is already in em.

How is this different from px to rem?

rem divides by the html font size. em divides by the parent.