PX to EM Converter

Convert pixels to em relative to a parent font size.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

Convert px to em

The em unit is relative to the font size of the parent element, which makes it useful for component-scoped sizing that scales with its context. This converter turns a pixel value into the equivalent em for a given parent font size, so you can move a design from fixed pixels to relative CSS units.

How it works

The conversion divides the pixel value by the parent element’s font size:

em = px ÷ parent font size (px)
px = em × parent font size (px)

The parent font size — not the root — is the divisor, because ems inherit and compound through nested elements. The default parent of 16px matches the browser’s usual root size.

Example

Convert 24px with a 16px parent:

  • 24 ÷ 16 = 1.5em

If the parent font size were 20px instead, the same 24px would be 24 ÷ 20 = 1.2em.

PixelsParentResult
24px16px1.5em
12px16px0.75em
24px20px1.2em

Enter your numbers and the result updates instantly, all in your browser.

Ad placeholder (rectangle)