Skip to main content
Frontend / CSS Tools

PX to EM Converter

Convert pixel values to em, based on the relevant parent/element font size (not the root) - formula shown clearly.

Enter a pixel value and the relevant parent font size - em is relative to that, not the document root, so this matters.

Unlike rem (always relative to the document root), em is relative to the specific element's own or parent's font size - make sure the value above matches the actual element you're styling.

If you actually mean the root font size rather than a specific parent element, you likely want the PX to REM Converter instead.

em vs. rem - Why This Distinction Matters

em is relative to the font size of the element it's used on (or its parent, for properties like font-size itself) - unlike rem, which is always relative to the root. This means the same em value can compute to different pixel sizes in different parts of a page, depending on nesting.

Why Use This Tool?

Because em is contextual, the conversion depends on knowing the correct parent font size for the specific element you're styling - not a single global root value. This tool makes that input explicit rather than assuming.

How to Use It

  1. Enter your pixel value.
  2. Enter the parent/element's actual font size that this em value will be relative to.
  3. Read the resulting em value.

Common Errors

Nested em values compound - if a parent's font-size is itself set in em relative to its own parent, the effective pixel size keeps multiplying down the tree. This tool converts one level at a time; deeply nested em chains need each level calculated in sequence.

Share this tool: