PX to EM Converter

Convert pixel values to em units instantly. Supports custom parent font size.

1em

What is EM in CSS?

EM is a CSS unit relative to the font size of its parent element. If a parent element has a font size of 16px, then 1em equals 16px inside that element. This makes EM useful for creating components that scale proportionally based on their context.

How to Convert PX to EM

The formula to convert pixels to em is straightforward. Divide the pixel value by the parent element font size.

em = px ÷ parent font size

Example: 24px ÷ 16px parent = 1.5em

EM vs REM — What is the Difference?

EM is relative to the parent element font size. REM is relative to the root element font size. EM can compound when nested — a child inside a parent both using EM will multiply. REM always refers back to the root so it never compounds. For most use cases, REM is more predictable than EM.

When to Use EM

EM is best used when you want a component to scale based on its immediate parent. Common use cases include padding and margin inside buttons and form elements, where the spacing should grow or shrink with the text size of that specific component.

Common PX to EM Conversions at 16px Base

10px = 0.625em
12px = 0.75em
14px = 0.875em
16px = 1em
18px = 1.125em
20px = 1.25em
24px = 1.5em
32px = 2em
48px = 3em