Calculator
How to use this calculator
- Enter your pixel value in Pixels.
- Set the Base size in pixels. Most browsers default to 16.
- Choose the number of Decimal places and press Convert.
- Copy the result or use the buttons to export CSV or a PDF snapshot of your calculation.
- Use the live preview to see the em size applied to text.
Formula used
The conversion from pixels to em is:
em = pixels / base
- pixels: the size you want to convert.
- base: the parent element’s font size (in pixels).
Example: 24 px with a base of 16 px → 24 / 16 = 1.5 em.
Example data table
| Pixels (px) | Base (px) | Em |
|---|
FAQs
What is an em unit
An em is a relative unit equal to the computed font size of the parent. It scales with user settings and improves accessibility.
What base size should I use
Most browsers use 16 px as the default text size. Use 16 unless your design sets a different base on the parent element.
How precise should my em values be
Two to three decimals are typically enough. Overly precise values can be harder to maintain without visible benefits.
What is the difference between em and rem
em is relative to the parent’s font size. rem is relative to the root (html) font size. Choose based on whether you want local or global scaling.
Will rounding affect layout
Minor rounding rarely harms layout. Consistent rounding rules and design tokens help maintain visual rhythm across components.