Em to Pixels
1 Em (em) = 16Pixel (px)
By KAMP Inc. / UnitOwl · Last reviewed:
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
- Determine the element's computed font size (check browser DevTools if unsure).
- Multiply the em value by the computed font size to get pixels.
- The formula is: px = em x computed-font-size.
- At the default 16px root: 0.5em = 8px, 1em = 16px, 1.5em = 24px, 2em = 32px.
- Warning: if the element has a different font size from the root, em resolves to that font size, not 16px.
Real-World Examples
Quick Reference
| Em (em) | Pixel (px) |
|---|---|
| 1 | 16 |
| 2 | 32 |
| 5 | 80 |
| 10 | 160 |
| 25 | 400 |
| 50 | 800 |
| 100 | 1,600 |
| 500 | 8,000 |
| 1,000 | 16,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.
Frequently Asked Questions
How do I find the computed font size of an element?
Does em work the same for all CSS properties?
Why would I convert em back to px?
Is em harder to debug than rem?
What is 2em in pixels at an 18px context?
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
- NIST β Units and Conversion Factors β Official unit conversion factors from the National Institute of Standards and Technology.
- BIPM β The International System of Units (SI) β International SI unit definitions from the International Bureau of Weights and Measures.