This calculation is based on an adjustable default parent element font-size of 16 pixels.
Use this free online em to px converter tool to convert any em value to the equivalent px CSS unit value. A px is a CSS unit of measurement that represents absolute length which is normatively defined as being equivalent to 1/96th of an inch.
Most browsers utilize a defualt font-size value of 16px. So, 1em is equivalent to 16px by default. However, if you decided to change the defualt font-size value of a parent HTML element, you can easily input your changed parent element font-size value to accurately convert from em to px using this instantaneously bidirectional converter.
EM | Pixels |
---|---|
0.0625em | 1px |
0.25em | 4px |
0.5em | 8px |
0.75em | 12px |
1em | 16px |
1.25em | 20px |
1.5em | 24px |
2em | 32px |
2.5em | 40px |
3em | 48px |
4em | 64px |
6em | 96px |
8em | 128px |
10em | 160px |
11em | 176px |
12em | 192px |
13em | 208px |
14em | 224px |
16em | 256px |
20em | 320px |
30em | 480px |
36em | 576px |
48em | 768px |
50em | 800px |
60em | 960px |
62em | 992px |
64em | 1024px |
70em | 1120px |
75rem | 1200px |
80em | 1280px |
90em | 1440px |
100em | 1600px |
120em | 1920px |
To convert em to px you should use the formula px = em * parent-element-font-size(font-size of HTML parent element). For example, if the HTML parent element font-size is 32px and you want to convert 3em to px, then 3em = 96px because 3*32 = 96.
The difference between em and px is that em is a scalable CSS unit of measurement that is relative to the font-size of the parent HTML element. While a px is a unit of absolute length which is normatively defined as being exactly 1/96th of 1 inch.
However, the use of px can create accessibility barriers such as not properly scaling the font-size in browsers. This is why it is better to use em due to it being a scalable CSS unit of measurement.
The difference between em and rem is that em is a CSS unit of measurement relative to the font-size of the parent HTML element. On the other hand, rem is a CSS unit of measurement relative to the font-size of the root HTML element.
Though both em and rem are scalable and relative units of size, when the font-size of a parent HTML element is changed, child elements utilizing em units within that parent HTML container will be affected, however, those using rem units will not be affected. Therefore, it is better in most cases to use rem becuase of its simplicity, consistency, and predictability when compared to em.