Skip to content

PX to EM Converter

Use this free PX to EM converter to change pixels (px) into em (em) instantly. Type a value and the result updates as you type. 1 pixel equals 0.0625 em.

0.0625 em
1 px = 0.0625 em

How to convert PX to EM

One pixel equals 0.0625 em, so to convert pixels to em use this formula:

em = px ÷ 16

Example: 10 px = 0.625 em

PX to EM conversion table

Pixels (px)Em (em)
0.1 px0.00625 em
0.5 px0.03125 em
1 px0.0625 em
2 px0.125 em
3 px0.1875 em
4 px0.25 em
5 px0.3125 em
6 px0.375 em
7 px0.4375 em
8 px0.5 em
9 px0.5625 em
10 px0.625 em
15 px0.9375 em
20 px1.25 em
25 px1.5625 em
30 px1.875 em
40 px2.5 em
50 px3.125 em
75 px4.6875 em
100 px6.25 em
250 px15.625 em
500 px31.25 em
1,000 px62.5 em

What is a pixel?

A CSS pixel is the reference unit for screens; 96 px = 1 inch in CSS.

What is a em?

em is relative to the font size of the parent element.

PX to EM depends on the context

Em is not tied to a fixed root. em = px ÷ context font size, where the context is the parent’s font size when you set font-size, and the element’s own font size for padding, margin, width and other properties.

Pixels12px context14px context16px context18px context20px context
8 px0.6667 em0.5714 em0.5 em0.4444 em0.4 em
12 px1 em0.8571 em0.75 em0.6667 em0.6 em
14 px1.1667 em1 em0.875 em0.7778 em0.7 em
16 px1.3333 em1.1429 em1 em0.8889 em0.8 em
18 px1.5 em1.2857 em1.125 em1 em0.9 em
20 px1.6667 em1.4286 em1.25 em1.1111 em1 em
24 px2 em1.7143 em1.5 em1.3333 em1.2 em
32 px2.6667 em2.2857 em2 em1.7778 em1.6 em

Example: an em-based button

Say a design has a button with 18px text and 12px × 24px padding. In em, measured against the button’s own 18px font size, the padding is 0.6667em 1.3333em.

Now make a large version by changing only the font size to 24px. The padding scales on its own to 16px × 32px, and the proportions stay the same. That is the main reason to use em: one font-size change resizes the whole component.

Common PX to EM mistakes

  • Dividing by 16 every time. Only correct when the context font size is 16px.
  • Using the parent size for padding. Padding in em uses the element’s own font size.
  • Ignoring compounding. Nested elements multiply em values, so 1.2em inside 1.2em renders at 1.44 times the base.
  • Using em when you need a fixed global size. For site-wide type and spacing, rem is easier. See PX to REM.

Frequently asked questions

There are 0.0625 em in one pixel.

One em equals 16 pixels.

Yes. It is free, needs no sign-up and works on mobile and desktop. All calculations run in your browser.

No. Em is relative to the parent (for font-size) or the element itself (for other properties) and compounds when nested. Rem is always relative to the root html font size.

24px is 1.5em when the context font size is 16px, or 1.3333em when it is 18px.

Related css units converters