DevBento logoDevBento
Tools/CSS Units Converter/Px to Em Converter

Px to Em Converter

Convert pixels to em units instantly with this free CSS converter. Adjust parent font size and watch the px to em conversion update in real time.

Γ·base
Viewport settings
UnitValue
pxPixel16
ptPoint12
pcPica1
cmCentimeter0.42333333
mmMillimeter4.2333333
inInch0.16666667
remRoot em1
emEm1
vwViewport width1.1111111
vhViewport height1.7777778
vminViewport minimum1.7777778
vmaxViewport maximum1.1111111
exx-height (approx)2
chCharacter width (approx)1.6666667
Related Tools
πŸ“CSS Units Converter
Convert between CSS units instantly: px, rem, em, vw, vh, pt, cm, mm, and more. Set your base font size and viewport dimensions for accurate conversions.
πŸ“Unit Converter
Convert between length, weight, temperature, speed, area, volume, data, and time units instantly. Metric, imperial, and more. No server, no signup.

Convert Pixels to Em

Enter a pixel value to convert it to em units. The conversion divides your pixel value by the parent element font size (default 16px). Unlike rem, em follows the nearest parent, which makes it ideal for components that scale as a unit.

Common Pixel to Em Values (16px Parent)

Pixels Em Use Case
12px 0.75em Small print inside a card
14px 0.875em Secondary text
16px 1em Matches parent exactly
20px 1.25em Lead paragraph
24px 1.5em Card heading
32px 2em Hero text inside a banner

The Compounding Trap

em multiplies down the tree. Three nested levels of 1.2em produce 1.728em at the leaf (1.2 x 1.2 x 1.2). This surprises developers styling nested lists and menus. Two fixes: set the multiplying factor on one level only, or use rem for the outer containers and em only inside the leaf component.

How to Use

  1. The tool opens with 16px pre-filled, converting to 1em
  2. Type any pixel value in the input field
  3. Change the parent font size to match your DevTools computed value
  4. Copy the em value from the results table

Real-World Example

A button has 16px text and the design calls for 12px vertical padding. 12 / 16 = 0.75em, so padding: 0.75em scales automatically if the button text grows to 20px. Fixed px padding would stay small while the text grows.

For root relative units try Px to Rem, or see every unit in the full CSS Units Converter.

πŸ”’

Nothing you paste leaves this tab. Every tool runs entirely in your browser β€” no upload, no server, no account.

Β© 2026 devbento.dev Β· built local-firstAll ToolsChangelog