Start with a worked example
Open the worked example for em. The example starts with Pixels = 16, Font size (px) = 16.
PX to EM Calculator formula
em = pixels ÷ font size in pixels.
Inputs and units
| Input | Format / range | Example |
|---|---|---|
| Pixels | Number | 16 |
| Font size (px) | min 1e-06 | 16 |
Worked example
The values listed in Inputs and units give 1 em for em.
- em
- 1 em
Results and assumptions
Change Pixels from 16 to 17.6 and keep the other example inputs fixed. The updated answer is 1.1 em (em).
Fix an input or unexpected result
Pixels is required. Enter pixels using the format and bounds in the input table. Zero and an empty field are different: use zero only if it is allowed and represents your data.
