Skip to content
FiftyCalc Free calculators for all 50 states

PX to EM Converter

Test cases replayed : 2 of 2 match · Methodology · No outside source listed

Enter the size and the font size it is relative to: the parent's for em, the root (html) element's for rem.

Result

Sample figures

em (or rem with the root size as base)—

Pixels (px) —

  • Points (pt)—
  • Percent of the base (%)—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

PX to EM Converter

Convert

Convert: choose px to em or em to px. Prefilled example: px to em.

Value (px or em): enter 0 or more. Prefilled example: 24.

Base font size (px), 16 in this example: enter 0 or more. Prefilled example: 16.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. Convert: choose px to em or em to px.
  2. Value (px or em): enter 0 or more.
  3. Base font size (px), 16 in this example: enter 0 or more.
  4. Read the result: em (or rem with the root size as base); the panel also shows Pixels (px), Points (pt) and Percent of the base (%).

How this calculator works

em = px ÷ base font size; px = em × base. In CSS, 1em is the font size of the element (the parent's for font-size itself) and rem is the font size of the root element (W3C, CSS Values and Units Level 4, w3.org/TR/css-values-4, read Oct 27, 2026).

The same specification fixes 1px = 1/96 in and 1pt = 1/72 in, so 1px = 0.75pt. The base font size is set by the browser and the page's style sheet; CSS leaves the default "medium" size to the browser (CSS Fonts Level 4), so check the value your page uses.

The formula

  1. Em={vbif m=1votherwise
Symbols used in the formula
SymbolMeaning
mConvert (1: px to em; 2: em to px)
vValue (px or em)
bBase font size (px), 16 in this example
Emem (or rem with the root size as base)

Worked example

Convertpx to em
Value (px or em)24
Base font size (px), 16 in this example16
Pixels (px)24
Points (pt)18
Percent of the base (%)150
  1. Em=2416=1.5

em (or rem with the root size as base) 1.5

Each step uses the unrounded value of the step before it; figures on this page are rounded for display.

Frequently asked questions

What is 24px in em with a 16px base?

1.5em.

How many pixels is 1.5em with an 18px base?

27px.

Related calculators