πŸ¦‰ UnitOwl

Em to Pixels

1 Em (em) = 16Pixel (px)

By KAMP Inc. / UnitOwl · Last reviewed:

Result
16 px
1 em = 16 px
Ad Slot (horizontal)

How to Convert Em to Pixels?

To convert em to pixels, multiply the em value by the element's computed font size (typically 16px for the root element). At a 16px base, 1em = 16px, 1.5em = 24px, and 2em = 32px. This conversion is commonly needed when debugging CSS layouts, calculating actual rendered sizes from em-based stylesheets, or translating responsive designs into pixel-accurate specifications for developers or QA teams. When a designer hands off a component with "padding: 1.5em" and a developer needs to verify the rendered size, converting back to pixels answers the question immediately. Understanding the em-to-px relationship is equally important for creating pixel-perfect implementations from em-based design systems. The catch is that em depends on context, so the same declaration can render differently in different parts of a page. That is why em-to-px conversion is most valuable during troubleshooting: it lets you confirm whether a layout issue comes from the intended design or from inherited font-size rules compounding farther up the DOM tree. Without that context, the same 1.25em rule can look inconsistent from one component to the next.

How to Convert Em to Pixel

  1. Determine the element's computed font size (check browser DevTools if unsure).
  2. Multiply the em value by the computed font size to get pixels.
  3. The formula is: px = em x computed-font-size.
  4. At the default 16px root: 0.5em = 8px, 1em = 16px, 1.5em = 24px, 2em = 32px.
  5. Warning: if the element has a different font size from the root, em resolves to that font size, not 16px.

Real-World Examples

A CSS rule sets margin: 1.25em on a paragraph with 16px font size.
1.25 x 16 = 20px margin on each side.
A button has padding: 0.75em 1.5em with a 14px font size.
Vertical: 0.75 x 14 = 10.5px. Horizontal: 1.5 x 14 = 21px.
A heading at 2em font-size inside a container with 18px font-size.
2 x 18 = 36px. The heading is 36px, not 32px, because em is relative to the parent's 18px.
A max-width: 40em on a content column (root: 16px).
40 x 16 = 640px. The content column maxes out at 640px at the default font size.
A paragraph uses line-height: 1.6em with an 18px font size.
1.6 x 18 = 28.8px. That line height gives the text noticeably more breathing room than the 18px font size alone.

Quick Reference

Em (em)Pixel (px)
116
232
580
10160
25400
50800
1001,600
5008,000
1,00016,000

History of Em and Pixel

The em unit has deep roots in typography. In metal typesetting, an "em quad" was a square space with sides equal to the point size of the type being set. A 12-point font had a 12-point em. CSS borrowed this concept but simplified it: 1em equals the computed font size of the current element. This made em a versatile relative unit for both text and layout. However, the compounding behavior of em in nested elements led to the creation of rem (root em) in CSS3, which always references the root font size.

Common Mistakes to Avoid

  • Always multiplying by 16, even when the element's font size differs. If a heading has font-size: 24px and its padding is 1em, that padding is 24px, not 16px. Em resolves to the element's own computed font size.
  • Forgetting about em compounding in nested elements. If a parent is 1.2em of the root (19.2px) and a child is 1.5em, the child's font size is 1.5 x 19.2 = 28.8px, not 1.5 x 16 = 24px.
  • Not using browser DevTools to verify. The computed tab in Chrome/Firefox DevTools shows the actual pixel value of any em-based property. Always verify rather than calculating manually when debugging.
  • Forgetting that em behaves differently on font-size than on most other properties. Font-size in em uses the parent as the reference, but padding, margin, and width in em use the element's own computed font size.
Ad Slot (auto)

Frequently Asked Questions

How do I find the computed font size of an element?
In Chrome DevTools: right-click the element, select "Inspect," go to the "Computed" tab, and search for "font-size." It shows the resolved pixel value. Firefox DevTools has the same feature. This is the value you multiply em by.
Does em work the same for all CSS properties?
When used for font-size, em refers to the parent's font-size. For all other properties (padding, margin, width, etc.), em refers to the current element's own computed font-size. This subtle difference can cause confusion.
Why would I convert em back to px?
For debugging layout issues, creating pixel-accurate QA specs, generating fixed-size outputs (email templates, PDF exports), or communicating with team members who think in pixels. The conversion helps verify that em-based designs render at the intended sizes.
Is em harder to debug than rem?
Usually yes. Rem always references the root font size, so the conversion path is short. Em depends on the current or parent font size, which means inheritance and nesting can change the final value. That flexibility is useful, but it also makes DevTools and explicit em-to-px checks more important.
What is 2em in pixels at an 18px context?
Multiply 2 by 18: 2em = 36px when the relevant computed font size is 18px. This is why em-based sizing can vary across components even with the same numeric value.
Quick Tip

When debugging em values in a complex layout, work from the root down. Start with the root font-size (usually 16px), then trace through each nesting level: if a section is 1.2em (19.2px) and a paragraph inside it is 0.9em, the paragraph is 0.9 x 19.2 = 17.28px. DevTools shows you the final computed value, saving you from manual cascade calculations.

Sources & References