Utilizor
Contact Us

CSS PX-EM Converter

A tool and guide for converting pixels to ems.

PX to EM Converter

Converting pixels to ems is important for creating scalable and accessible websites.

The Formula

The standard formula is: Target / Context = Result

Usually, the browser default font size is 16px. So, if you want a font size of 24px:

24px / 16px = 1.5em

Conversion Table (Base 16px)

Pixels (px)EMs (em)
12px0.75em
14px0.875em
16px1em
18px1.125em
24px1.5em
32px2em

Example

/* Setting base font size */
body {
  font-size: 100%; /* Equals 16px */
}

h1 {
  font-size: 2.5em; /* 40px */
}