PX to EM Converter
Convert px to rem, rem to px and px to em at any base font size, with a copy-ready CSS line and a live reference table.
Result
This page opens the converter in the px → em direction. The arithmetic is the same division as for rem — pixels divided by a reference font size — but the reference is different: em is relative to the font size of the parent element (or, for font-size itself, the element's inherited size), not to the root.
That difference is exactly when you reach for em: padding that should grow with the component's own text, media queries written in em, or a button whose spacing scales when its font size changes. Enter the parent's actual font size in the base field — if your component sits in 14px text, 21px of padding is 1.5em, not 1.3125em.
The result comes with a copy-ready CSS line, and the reference table shows the common pixel sizes converted against the current parent size. Everything updates live in your browser as you type, with no data leaving the page.