TXT · Text & Data tools

PX to EM Converter

Pixels (px) Input
Element Em (em) Output
Pixels (px)InputElement Em (em)Output6Items
Go to full CSS Unit Converter

Convert px to em

Enter pixel values one per line or paste CSS containing px lengths. The output divides each matching value by 16 and adds the em unit.

24px becomes 1.5em, and 8px becomes 0.5em.

EM reference size

Unlike rem, em is contextual. Font sizes use the parent element as their reference, while many other properties use the current element’s computed font size.

The focused conversion uses a 16px reference. Open the full converter when the relevant element uses another size.

CSS replacement

Pasted declarations keep their formatting. Only values with a px suffix are changed; other units and unitless values remain as written.

Frequently Asked Questions

Divide the pixel value by the reference font size. With a 16px reference, 24px divided by 16 equals 1.5em.

The focused converter uses a 16px reference. Open the full CSS Unit Converter to set another base value.

No. In CSS, em depends on the font size of the element's context. Use the reference size that matches the element you are calculating.

Focused CSS unit converters

Full CSS Unit Converter tool

Explore Our Tools

Browse all tools