Pixel Converter

PX to EM Converter

Convert pixels to em based on a parent font-size. em is a font-relative CSS unit, so the result scales with whatever base size you set.

Parent/root font-size the relative unit is measured against.

Result

1em

Formula

em = px ÷ base font-size (default 16px)

Conversion table

px → em at base font-size (px) = 16.

pxem
1px0.0625em
2px0.125em
4px0.25em
8px0.5em
10px0.625em
12px0.75em
14px0.875em
16px1em
18px1.125em
20px1.25em
24px1.5em
32px2em
40px2.5em
48px3em
64px4em
80px5em
96px6em
128px8em

About the PX to EM conversion

The em is a font-relative CSS unit: 1em equals the font-size of the element’s parent. Because it is relative rather than absolute, em lets you build layouts that scale with the user’s text size — a core requirement for accessible, responsive email and web design.

To convert px to em you divide the pixel value by the base font-size. With the browser default of 16px, 16px becomes 1em, 24px becomes 1.5em, and 8px becomes 0.5em. Change the base to match the font-size on the element you are styling and the em output updates live.

Use this px to em converter when you are migrating a fixed pixel design to a fluid, accessible one, or when a design system mandates em-based spacing and typography.

Related converters

PX to EM Converter FAQs

Divide the pixel value by the base font-size. At the default 16px base, em = px / 16 — so 16px = 1em and 32px = 2em. Set the base field to the font-size of the element you are styling for an exact result.
Browsers default the root font-size to 16px, so this converter uses 16px as the base unless you change it. If the parent element sets a different font-size, enter that value in the Base field.
A pixel (px) is an absolute unit — it is always the same size. An em is relative to its parent element’s font-size, so it scales when the surrounding text scales. em is preferred for accessible, responsive layouts.
Use rem when you want sizing relative to the single root font-size (predictable, no compounding). Use em when you want sizing relative to the local element’s font-size, which is useful for component-scoped spacing.