PX to EM Converter

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.

How to Convert PX to EM

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

Conversion direction
Result1em

16px ÷ 16px = 1em

Agencies: I take WordPress overflow work. See white label support

PX to EM conversion table (16px base)

Most browsers start at 16px, so these are the values I reach for most. Each one is px ÷ 16.

PX to EM conversion at a 16px base. Using a different base? Put it in the converter above.
PixelsEM
8px0.5em
10px0.625em
12px0.75em
13px0.8125em
14px0.875em
15px0.9375em
16px1em
18px1.125em
20px1.25em
22px1.375em
24px1.5em
28px1.75em
30px1.875em
32px2em
36px2.25em
40px2.5em
48px3em
56px3.5em
64px4em
72px4.5em
80px5em
96px6em

EM to PX conversion table (16px base)

Going the other way, multiply by the base: em × 16 = px.

EM to pixel calculator shortcut: em × base font size = px.
EMPixels
0.25em4px
0.5em8px
0.625em10px
0.75em12px
0.875em14px
1em16px
1.125em18px
1.25em20px
1.5em24px
1.75em28px
2em32px
2.5em40px
3em48px
4em64px
5em80px

Same values at other base sizes

Each value is px ÷ base, rounded to 3 decimals.
PXBase 10pxBase 12pxBase 14pxBase 18pxBase 20px
12px1.2em1em0.857em0.667em0.6em
14px1.4em1.167em1em0.778em0.7em
16px1.6em1.333em1.143em0.889em0.8em
18px1.8em1.5em1.286em1em0.9em
24px2.4em2em1.714em1.333em1.2em
32px3.2em2.667em2.286em1.778em1.6em

FAQ

Frequently Asked Questions

How many pixels is 1em?

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.

Need a developer, not just a converter?

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