← Digital, Network & Web

Unit Converter

EM to PX Converter

Calculate the CSS pixel length of an em value using the computed font size appropriate to its property.

Resolve em in CSS pixels

Result—

Use the parent’s computed font size for font-size declarations and the element’s computed font size for ordinary lengths. Nested font-size declarations can compound.

Your calculation stays in your browser.

EM to PX Converter examples

InputExpected result
1.5 em length, element font 16 px24 CSS px
1.5 em font-size, parent font 20 px30 CSS px
0.75 em length, element font 16 px12 CSS px
−0.5 em margin, element font 16 px−8 CSS px

Supported units & limits

Accepts decimal or scientific-notation values, zero and signed ordinary lengths. font-size cannot be negative. The font reference must be strictly positive. Enter values without unit suffixes. The calculator resolves a single element-style length at the supplied reference; it does not traverse a DOM, resolve media queries or measure glyphs. Display results use selectable significant digits and reject overflow or underflow.

Common mistakes

A parent’s font size is not always the correct multiplier. For example, margin: 1em uses the styled element’s computed font size, even if a parent has a different size. rem uses the root instead. Do not multiply by device pixel ratio when comparing CSS lengths. Nested em font sizes multiply, so check the inherited size before entering it in the EM to PX Converter.

Privacy

Conversions run in your browser. This site does not upload or store the values you enter. We use Google Analytics, loaded through Google Tag Manager, to count page visits and see which tools are used; Google may set cookies for this. The hosting server may keep standard access logs when you load a page.

Conversion guide

Inspect a nested em declaration

Choose the property context before entering a reference. For font-size: 1.5em in a 20 px parent, use 20 to obtain 30 px. If that same element has margin: 1em, use its computed 30 px font size to obtain a 30 px margin. This two-step check helps explain apparent size changes in nested components.

EM to PX Converter FAQ

Does em always refer to the parent font?

No. In a font-size declaration it uses the inherited font size. In ordinary length properties it uses the element’s own computed font size.

Why do nested em font sizes get larger?

Each font-size declaration resolves against its inherited size. A child at 1.5 em inside a 20 px parent computes to 30 px; another 1.5 em child inside it computes to 45 px.

Is the pixel result a text height measurement?

No. CSS font-size specifies a font size. Visible glyph height and the line box also depend on the font and line-height.