ToolCanvas

PX to EM Converter

Convert pixels (PX) to em units instantly and vice versa with adjustable parent font size.

PX to EM Converter
Convert pixels to em relative to the parent element's font size.
px
em
px
16px=1em

PX to EM Formula

EM = PX ÷ Parent Font Size

Example: 24 ÷ 16 = 1.5em

EM to PX Formula

PX = EM × Parent Font Size

Example: 1.5 × 16 = 24px

PX ↔ EM Conversion Tables

Reference values assuming a 16px parent font size. Adjust the parent size in the converter for nested contexts.

Pixels to EM

PixelsEM
1px0.0625em
2px0.125em
3px0.1875em
4px0.25em
5px0.3125em
6px0.375em
8px0.5em
10px0.625em
12px0.75em
14px0.875em
15px0.9375em
16px1em
18px1.125em
20px1.25em
24px1.5em
25px1.5625em
28px1.75em
32px2em
36px2.25em
40px2.5em
44px2.75em
48px3em
50px3.125em
56px3.5em
64px4em
72px4.5em
75px4.6875em
80px5em
90px5.625em
100px6.25em

EM to Pixels

EMPixels
0.01em0.16px
0.03em0.48px
0.05em0.8px
0.08em1.28px
0.1em1.6px
0.15em2.4px
0.2em3.2px
0.5em8px
1em16px
2em32px
3em48px
4em64px
5em80px
6em96px
8em128px
10em160px
15em240px
20em320px
30em480px
40em640px
50em800px
60em960px
80em1280px
100em1600px

EM vs REM

FeatureEMREM
Relative toParent font sizeRoot font size
Compounds when nestedYesNo
Best forComponent-local scalingGlobal layout & typography
PredictabilityLower in deep treesHigh everywhere
AccessibilityGoodExcellent

What Is EM in CSS?

EM is a relative CSS unit equal to the computed font size of the element itself (for font-size) or its parent (for other properties like padding and margin). If a parent has font-size: 16px, then 1em = 16px for lengths on child elements.

How PX to EM Conversion Works

Divide your pixel value by the parent's font size:

em = px ÷ parent font size

Example: with a 16px parent, 20px → 1.25em and 32px → 2em. If the parent is 18px instead, 27px → 1.5em (27 ÷ 18).

Why EM Compounds

Nested em values multiply. A grandparent at 1.2em with a child at 1.2em produces text that is 1.44× the root — not 1.2×. This makes em powerful for self-contained components but risky for page-wide layout. REM avoids this by always referencing the root.

Common PX to EM Examples (16px parent)

  • 12px → 0.75em
  • 14px → 0.875em
  • 16px → 1em
  • 18px → 1.125em
  • 24px → 1.5em
  • 32px → 2em

Best Practices

  • Use rem for page-level spacing and typography.
  • Use em inside components that should scale with their parent's text size.
  • Avoid deep em nesting without a clear mental model of the cascade.
  • Always know the parent's computed font-size before converting px to em.

Frequently Asked Questions