AyeCalc
All tools
Developer units

EM to PX Converter

Find the pixel equivalent of an em measurement in its actual CSS context. Enter the component's computed font size instead of assuming every em is based on 16px.

Instant resultAdjustable assumptionsNo data sent
Instant conversion

em px

Runs in your browser
pixels16px

Result rounded to a maximum of six decimal places.

Conversion rulepx = em × element font size

At a 16px element size: px = em × 16.

01
Method

How to convert ems to pixels

Multiply the em value by the relevant element or parent font size. In a 16px context, 1em equals 16px and 1.5em equals 24px.

Formulapx = em × element font size

At a 16px element size: px = em × 16.

02
Worked example

Convert 1.5 em to px

Apply the conversion rule to 1.5 ems. Using the default settings, the result is 24 px.

1.5 em24 px

Default context: element font size 16px.

03
Quick reference

em to px conversion table

These pre-calculated values use the same formula and default settings as the converter above.

Common ems to pixels conversions
ems (em)pixels (px)
0.125 em2 px
0.25 em4 px
0.5 em8 px
0.75 em12 px
1 em16 px
1.125 em18 px
1.25 em20 px
1.5 em24 px
2 em32 px
2.5 em40 px
3 em48 px
4 em64 px
5 em80 px
6 em96 px
04
Practical use

Code and calculation snippets

Reuse the same conversion in a stylesheet or application. Keep contextual font sizes configurable when working with relative CSS units.

CSS
.component {
  font-size: 16px;
  padding: 1.5em; /* 24px */
}
JavaScript
const pixels = em * elementFontSize;
Sass
@function px-from-em($em, $context: 16) {
  @return $em * $context * 1px;
}
05
Interpretation

Using the result accurately

Use the browser's computed styles to identify the effective font-size context. This is especially important for nested components that inherit or override font size.

Important limitation

The calculation is only as accurate as the supplied context. Nested em declarations and property-specific behavior can make the effective base different from the root font size.

Reference: W3C CSS Values and Units: font-relative lengths.

Common questions

EM to PX Converter FAQ

Short answers about the formula, assumptions, and displayed precision.

How do I convert ems to pixels?

Multiply the em value by the relevant element or parent font size. In a 16px context, 1em equals 16px and 1.5em equals 24px. For example, 1.5 em converts to 24 px using the default settings.

What formula does this em-to-px converter use?

px = em × element font size. At a 16px element size: px = em × 16.

What assumptions does the calculator make?

The calculator starts with 16px for the element font size. You can change it to match your CSS.

How many decimal places should I use?

The calculator shows up to six decimal places and removes unnecessary trailing zeros. Keep more precision for further calculations, then round the final value to suit your measurement or design system.