PX to EM converter

To convert px to em, divide the pixel value by the parent font size: at a 16px parent, 16px = 1em, 24px = 1.5em and 14px = 0.875em. Enter any value and parent size below, or switch to em to px.

em is relative to the parent element's font size; use 16 if the parent inherits the browser default.

1.5em (150%) at a 16px parent

font-size: 1.5em;

Conversion table (parent 16px)

PixelsEM
1px0.0625em
2px0.125em
4px0.25em
6px0.375em
8px0.5em
10px0.625em
12px0.75em
14px0.875em
15px0.9375em
16px1em
18px1.125em
20px1.25em
24px1.5em
28px1.75em
30px1.875em
32px2em
36px2.25em
40px2.5em
48px3em
56px3.5em
64px4em
72px4.5em
80px5em
96px6em
128px8em

PX to EM conversion table (16px parent)

PixelsEM
1px0.0625em
2px0.125em
4px0.25em
6px0.375em
8px0.5em
10px0.625em
12px0.75em
14px0.875em
15px0.9375em
16px1em
18px1.125em
20px1.25em
24px1.5em
28px1.75em
30px1.875em
32px2em
36px2.25em
40px2.5em
48px3em
56px3.5em
64px4em
72px4.5em
80px5em
96px6em
128px8em

How to convert px to em

Divide the pixel value by the font size of the parent element:

em = px / parent font size
px = em x parent font size

24px at a 16px parent -> 24 / 16 = 1.5em
1.25em at a 16px parent -> 1.25 x 16 = 20px

The parent matters: 24px is 1.5em inside a 16px card but 1.2em inside a 20px card. If the parent inherits the browser default without another font-size declaration, use 16px.

EM vs REM: what is the difference?

PropertyEMREM
Relative toParent element font sizeRoot html font size
Compounds when nestedYesNo
Best forPadding and margins that scale with a component's own text, media queriesGlobal type and spacing

Related typography tools

Convert in the other direction or pair relative units with fluid type.

Frequently asked questions

How many em is 16px?

16px is 1em at a 16px parent font size, because 16 ÷ 16 = 1. If the parent font size is 20px, 16px is 0.8em. Always divide the pixel value by the parent font size to get the em value.

How do I convert px to em?

Divide the pixel value by the parent font size: em = px / parent font size. For example, 20px at a 16px parent is 20 ÷ 16 = 1.25em, and 18px at a 12px parent is 18 ÷ 12 = 1.5em.

What is 24px in em?

24px is 1.5em at a 16px parent font size because 24 ÷ 16 = 1.5. At a 20px parent, 24px is 1.2em. The converter lets you change the parent size to match your CSS.

Should I use em or rem for font sizes?

Use rem for page text because it always references the root font size and does not compound when elements nest. Use em for component padding and icons that should scale with their own text.

More typography & unit tools

Color tools

Image tools

CSS generators

Image & SVG tools

More free tools

All free tools