A free pixels to em converter and px to em calculator. Type a pixel value, set your base font size, and copy the em value straight into your CSS. Need em to px instead? Switch the converter to EM to PX, or use the tables below.
Quick answer: 1em = 16px when the parent font size is 16px, which is the browser default. Em is relative, so inside a 20px parent the same 1em is 20px.
The formula: em = px ÷ base, and px = em × base. The base is the font size of the parent element. So 24px ÷ 16 = 1.5em, and 1.5em × 16 = 24px. The converter below does both directions for any base font size, and you can copy the result straight into your CSS.
em vs rem: em follows the parent element, so it compounds when you nest elements. rem always follows the root (html) font size, so 1.5rem is the same size everywhere on the page. Working in rem? Use my PX to REM converter.
PX to EM Converter
formula: px ÷ base font size = em
16px ÷ 16px = 1em
Agencies: I take WordPress overflow work. See white label support
Most browsers start at 16px, so these are the values I reach for most. Each one is px ÷ 16.
| Pixels | EM |
|---|---|
| 8px | 0.5em |
| 10px | 0.625em |
| 12px | 0.75em |
| 13px | 0.8125em |
| 14px | 0.875em |
| 15px | 0.9375em |
| 16px | 1em |
| 18px | 1.125em |
| 20px | 1.25em |
| 22px | 1.375em |
| 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 |
Going the other way, multiply by the base: em × 16 = px.
| EM | Pixels |
|---|---|
| 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 |
| PX | Base 10px | Base 12px | Base 14px | Base 18px | Base 20px |
|---|---|---|---|---|---|
| 12px | 1.2em | 1em | 0.857em | 0.667em | 0.6em |
| 14px | 1.4em | 1.167em | 1em | 0.778em | 0.7em |
| 16px | 1.6em | 1.333em | 1.143em | 0.889em | 0.8em |
| 18px | 1.8em | 1.5em | 1.286em | 1em | 0.9em |
| 24px | 2.4em | 2em | 1.714em | 1.333em | 1.2em |
| 32px | 3.2em | 2.667em | 2.286em | 1.778em | 1.6em |
FAQ
At the default browser font size, 1em is 16px. But em is relative: inside an element with a 20px font size, 1em is 20px. That’s the whole point of the unit, and also the thing that trips people up.
Multiply the em value by the base font size. 1.5em at a 16px base is 1.5 × 16 = 24px. If the parent’s font size is 18px, the same 1.5em is 27px.
Divide the pixel value by the base font size. 24px ÷ 16px = 1.5em. The converter above does this for any base, and the table covers the common sizes.
Px is fixed. Em is relative to the font size of the parent element. Rem is relative to the root (html) font size only, so it doesn’t compound when you nest elements. I use rem for most font sizes and em for spacing that should grow with its own text, like button padding.
Use the font size of the parent element. If you haven’t changed anything, that’s the browser default of 16px. If your theme sets the body to 18px, use 18 as the base or your em values will come out too small.
It usually means converting an em value from one context to another, for example 1.5em inside a 20px parent to the matching value inside a 16px parent. Convert to px first (1.5 × 20 = 30px), then back to em at the new base (30 ÷ 16 = 1.875em).
Em scales with the text around it, so it respects a visitor who has set a bigger default font size in their browser. That’s better for accessibility and it keeps spacing in proportion when the text size changes.
Not directly. What it does measure is how your page holds up on mobile: text that’s readable without zooming and tap targets that aren’t cramped. Relative units make that easier to get right across screen sizes.
I build and look after WordPress sites every month: updates, backups, speed and small CSS fixes like this one. Plans start at $169 USD a month.
Want to check your site’s speed first? Get my free website check