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
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.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- Convert: choose px to em or em to px.
- Value (px or em): enter 0 or more.
- Base font size (px), 16 in this example: enter 0 or more.
- 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
| Symbol | Meaning |
|---|---|
| Convert (1: px to em; 2: em to px) | |
| Value (px or em) | |
| Base font size (px), 16 in this example | |
| em (or rem with the root size as base) |
Worked example
| Convert | px to em |
|---|---|
| Value (px or em) | 24 |
| Base font size (px), 16 in this example | 16 |
| Pixels (px) | 24 |
|---|---|
| Points (pt) | 18 |
| Percent of the base (%) | 150 |
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.