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.
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 px | 0.00625 em |
| 0.5 px | 0.03125 em |
| 1 px | 0.0625 em |
| 2 px | 0.125 em |
| 3 px | 0.1875 em |
| 4 px | 0.25 em |
| 5 px | 0.3125 em |
| 6 px | 0.375 em |
| 7 px | 0.4375 em |
| 8 px | 0.5 em |
| 9 px | 0.5625 em |
| 10 px | 0.625 em |
| 15 px | 0.9375 em |
| 20 px | 1.25 em |
| 25 px | 1.5625 em |
| 30 px | 1.875 em |
| 40 px | 2.5 em |
| 50 px | 3.125 em |
| 75 px | 4.6875 em |
| 100 px | 6.25 em |
| 250 px | 15.625 em |
| 500 px | 31.25 em |
| 1,000 px | 62.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.
| Pixels | 12px context | 14px context | 16px context | 18px context | 20px context |
|---|---|---|---|---|---|
| 8 px | 0.6667 em | 0.5714 em | 0.5 em | 0.4444 em | 0.4 em |
| 12 px | 1 em | 0.8571 em | 0.75 em | 0.6667 em | 0.6 em |
| 14 px | 1.1667 em | 1 em | 0.875 em | 0.7778 em | 0.7 em |
| 16 px | 1.3333 em | 1.1429 em | 1 em | 0.8889 em | 0.8 em |
| 18 px | 1.5 em | 1.2857 em | 1.125 em | 1 em | 0.9 em |
| 20 px | 1.6667 em | 1.4286 em | 1.25 em | 1.1111 em | 1 em |
| 24 px | 2 em | 1.7143 em | 1.5 em | 1.3333 em | 1.2 em |
| 32 px | 2.6667 em | 2.2857 em | 2 em | 1.7778 em | 1.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
How many em are in a pixel?
There are 0.0625 em in one pixel.
How many pixels are in a em?
One em equals 16 pixels.
What is the formula to convert PX to EM?
em = px ÷ 16
Is this PX to EM converter free?
Yes. It is free, needs no sign-up and works on mobile and desktop. All calculations run in your browser.
Is em the same as rem?
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.
What is 24px in em?
24px is 1.5em when the context font size is 16px, or 1.3333em when it is 18px.
