EM to PX Converter — Decode Parent-Relative CSS Units
When a design looks wrong and the culprit is an em value deep in a nested stylesheet, you need to know the exact rendered pixel size at that specific DOM depth. This tool decodes em values back to pixels given any parent font-size.
Convert em CSS values back to their actual pixel rendering size based on your element's parent font-size. Debug unexpected text scaling caused by em compounding in nested layouts and component libraries.
Debugging EM Rendering in the DOM
To decode an em value, multiply it by the parent element's computed font size. If the parent is 20px (from its own em chain), then 1.5em = 30px — not 24px. Always check the computed parent font-size in browser DevTools before converting.
- 1Open browser DevTools and inspect the parent element to find its computed font-size.
- 2Enter that parent font-size into the base field.
- 3Input the em value you are debugging to see the exact pixel size it renders at.
EM to Pixel Decoding Formula
To reverse an em value, multiply the em number by the parent element's computed font-size in pixels. The parent font-size is crucial — it is not always 16px if em values have been cascading.
PX = EM × Parent Element Computed Font Size
Example: 1.5em × 20px parent = 30px actualEM to Pixel at Common Parent Sizes
This table decodes common em values at three typical parent font-sizes (14px, 16px, and 20px) to help debug responsive component layouts:
| EM Value | PX at 14px | 16px | 20px parent |
|---|---|
| 0.75em | 10.5px | 12px | 15px |
| 0.875em | 12.25px | 14px | 17.5px |
| 1em | 14px | 16px | 20px |
| 1.125em | 15.75px | 18px | 22.5px |
| 1.25em | 17.5px | 20px | 25px |
| 1.5em | 21px | 24px | 30px |
| 1.75em | 24.5px | 28px | 35px |
| 2em | 28px | 32px | 40px |
| 2.5em | 35px | 40px | 50px |
| 3em | 42px | 48px | 60px |
EM Debugging FAQs
In Chrome/Firefox, right-click the element and select Inspect. In the Computed styles panel, search for font-size. This is the exact size your em values will multiply against.
Because em is relative to the parent's font-size, not a global constant. If component A has a 16px parent and component B has a 20px parent, the same 1.5em value will render as 24px vs 30px respectively.
It depends on the scope. If your em values are used for component-internal spacing (where you want them to scale with the component font-size), keep them. If they cause unexpected cascading in page-level layouts, migrating to rem is safer.
EM debugging requires knowing the parent context — without it, the same value produces completely different results. Use this tool alongside browser DevTools to quickly decode any em value in your component tree.
Related Tools
