How many pixels is 1em?
1em is 16px when the parent font size is the browser default of 16px. If the parent font size is 20px, 1em is 20px: always multiply the em value by the parent font size.
To convert em to px, multiply the em value by the parent element's font size: px = em × parent font size. At the browser default of 16px, 1em = 16px, 1.5em = 24px and 0.875em = 14px. Enter any value and parent size below.
em is relative to the parent element's font size; use 16 if the parent inherits the browser default.
24px at a 16px parent
font-size: 24px;Conversion table (parent 16px)
| EM | Pixels |
|---|---|
| 0.125em | 2px |
| 0.25em | 4px |
| 0.5em | 8px |
| 0.625em | 10px |
| 0.75em | 12px |
| 0.875em | 14px |
| 1em | 16px |
| 1.125em | 18px |
| 1.25em | 20px |
| 1.5em | 24px |
| 1.75em | 28px |
| 2em | 32px |
| 2.5em | 40px |
| 3em | 48px |
| 4em | 64px |
| 5em | 80px |
| 6em | 96px |
| 8em | 128px |
| EM | Pixels |
|---|---|
| 0.125em | 2px |
| 0.25em | 4px |
| 0.5em | 8px |
| 0.625em | 10px |
| 0.75em | 12px |
| 0.875em | 14px |
| 1em | 16px |
| 1.125em | 18px |
| 1.25em | 20px |
| 1.5em | 24px |
| 1.75em | 28px |
| 2em | 32px |
| 2.5em | 40px |
| 3em | 48px |
| 4em | 64px |
| 5em | 80px |
| 6em | 96px |
| 8em | 128px |
Multiply the em value by the font size of the parent element:
px = em × parent font size em = px ÷ parent font size 1.5em at a 16px parent → 1.5 × 16 = 24px 24px at a 16px parent → 24 ÷ 16 = 1.5em
The parent matters: 1.5em is 24px inside a 16px card but 30px inside a 20px card. If the parent inherits the browser default without another font-size declaration, use 16px.
| Property | EM | REM |
|---|---|---|
| Relative to | Parent element font size | Root html font size |
| Compounds when nested | Yes | No |
| Best for | Padding and margins that scale with a component's own text, media queries | Global type and spacing |
Convert in the other direction or pair relative units with fluid type.
1em is 16px when the parent font size is the browser default of 16px. If the parent font size is 20px, 1em is 20px: always multiply the em value by the parent font size.
1.5em is 24px at a 16px parent font size because 1.5 × 16 = 24. At a 20px parent, 1.5em is 30px. The converter lets you change the parent size to match your CSS.
Divide the pixel value by the parent font size. For example, 24px ÷ 16px = 1.5em and 14px ÷ 16px = 0.875em. Use the PX → EM tab above to convert in that direction.
em is relative to the parent element's font size, so nested em values multiply. Two nested elements set to 1.5em produce 2.25 times the outer font size. Use rem instead when sizes should always reference the root html font size.