Skip to content
Dozo Tools

px = em × parent

em to px converter

Rem, px, and em

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.

Start typing a value in any field above.

Copies the pixels field.

Common sizes

Start typing a value.

2em at a parent of 18px is 36px. That 36px is 2.25rem while the root stays 16, because rem ignores the parent.

Em compounds: 1.2em inside another 1.2em is 1.44 times the outer computed size, not 1.2 times the root. Put the parent’s computed pixel size in the parent field. Leave the root at 16 unless html is set otherwise.

em in px at a 16px parent and an 18px parent
empx (parent 16px)px (parent 18px)
0.589
11618
1.219.221.6
1.52427
23236

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

Questions

How do you convert em to px?

Multiply em by the parent font size, not the root. px = em × parent. 2em at 18px is 36px.

Why is nested em larger than 1.2 times the root?

Each level multiplies. 1.2em inside another 1.2em is 1.44 times the outer computed size, not 1.2 times the root.

What is 2em in rem when the parent is 18px and the root is 16px?

2em is 36px. 36 / 16 is 2.25rem. rem did not look at the parent.

Which field should move for em?

The parent field. Leave the root at 16 unless html is set to something else.