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.
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)
| Pixels | EM |
|---|---|
| 1px | 0.0625em |
| 2px | 0.125em |
| 4px | 0.25em |
| 6px | 0.375em |
| 8px | 0.5em |
| 10px | 0.625em |
| 12px | 0.75em |
| 14px | 0.875em |
| 15px | 0.9375em |
| 16px | 1em |
| 18px | 1.125em |
| 20px | 1.25em |
| 24px | 1.5em |
| 28px | 1.75em |
| 30px | 1.875em |
| 32px | 2em |
| 36px | 2.25em |
| 40px | 2.5em |
| 48px | 3em |
| 56px | 3.5em |
| 64px | 4em |
| 72px | 4.5em |
| 80px | 5em |
| 96px | 6em |
| 128px | 8em |
| Pixels | EM |
|---|---|
| 1px | 0.0625em |
| 2px | 0.125em |
| 4px | 0.25em |
| 6px | 0.375em |
| 8px | 0.5em |
| 10px | 0.625em |
| 12px | 0.75em |
| 14px | 0.875em |
| 15px | 0.9375em |
| 16px | 1em |
| 18px | 1.125em |
| 20px | 1.25em |
| 24px | 1.5em |
| 28px | 1.75em |
| 30px | 1.875em |
| 32px | 2em |
| 36px | 2.25em |
| 40px | 2.5em |
| 48px | 3em |
| 56px | 3.5em |
| 64px | 4em |
| 72px | 4.5em |
| 80px | 5em |
| 96px | 6em |
| 128px | 8em |
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.
| 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.
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.
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.
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.
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.