PX to EM Converter

Calculate EM values from pixels based on parent font size context

Safe conversion with no data sent to server

px
em

Reference Table

Pixels (px)RemEm
1px0.0625rem0.0625em
2px0.125rem0.125em
4px0.25rem0.25em
8px0.5rem0.5em
10px0.625rem0.625em
12px0.75rem0.75em
14px0.875rem0.875em
16px1rem1em
18px1.125rem1.125em
20px1.25rem1.25em
24px1.5rem1.5em
32px2rem2em
48px3rem3em
64px4rem4em

What is EM in CSS?

The EM unit is relative to the font-size of its immediate or nearest parent element. If a parent container has a font-size of 20px, then 1em inside that container equals 20px. If that element then sets its own font-size to 2em (now 40px), any margins or paddings on that element specified in ems will be relative to 40px.

PX vs REM vs EM

While PX is absolute, REM and EM are relative. REM is relative to the root (`<html>`) font size, making it highly predictable globally. EM is relative to its direct parent, which is incredibly useful for modular components (like a button where the padding scales up proportionally if you change its base font size), but can lead to complex compounding math when nested deeply.