PX To EM Converter
px
What is PX to EM Converter?
The term “Em” basically refers to the width of the letter “M” in a given typeface. And Px (pixel) stands for “Picture Element.” The Pixels to Em Converter is a free online tool primarily used by designers and developers to convert pixel values into Em values.

Why Use Pixel to Em Converter?
There are many uses of this converter, some of them are as follows:
- It boosts the website’s responsiveness.
- Em value enhances the website accessibility.
- It helps to optimize CSS for scalability.
- This converter improves SEO and core web vitals.
How to Convert Pixel to Em?
Use this calculator by following the steps below:
Step 1: Enter the base value in the mentioned column.
Step 2: Then, write the px value that you want to convert.
Step 3: Press the convert button and get the result instantly.
Pixels to Em Formula
If you are confused and want to make sure that the calculator is giving you the correct value, then you can double-cross it with the following formula:
em=px/Base Font Size (The default font size is 16px)
For example, If the base font size is 16px, then,
- 32px = 2em
- 24px = 1.5em
- 16px = 1em
- 8px = 0.5em
Pixel to Em Conversion Table
The table below shows some common px to em conversions for web design elements, such as font sizes, element width, and breakpoints. Moreover, these conversions are set based on a default base font size that is 16px, which is commonly used in web development & Cascading style sheet. But for more accurate results, you can use the above calculator.
PX | EM |
---|---|
4px | 0.25em |
8px | 0.5em |
12px | 0.75em |
16px | 1em |
20px | 1.25em |
24px | 1.5em |
32px | 2em |
40px | 2.5em |
48px | 3em |
64px | 4em |
80px | 5em |
96px | 6em |
112px | 7em |
128px | 8em |
160px | 10em |
176px | 11em |
192px | 12em |
208px | 13em |
224px | 14em |
240px | 15em |
256px | 16em |
288px | 18em |
320px | 20em |
384px | 24em |
480px | 30em |
512px | 32em |
640px | 40em |
768px | 48em |
960px | 60em |
1024px | 64em |
1280px | 80em |
1536px | 96em |
1920px | 120em |
2000px | 125em |
Difference Between Px and Em
Both Px and em are units of measurement. But they differ in size.
Pixels are absolute units that have a fixed value. Furthermore, their size can’t be changed on the screen unless by a user setting. Pixels show control and fixed dimensions.
On the other hand, em’s are relative units that are changeable. It drives its size parent element that shows the computed font size. Ems shows scalability and elasticity.
Want to do vice versa? Try em to px here.
Few Valuable Examples of PX
Below are few valuable examples of how px (pixels) work in CSS, covering different scenarios like fixed sizing, layout consistency, spacing, and responsiveness.
Example 1: Fixed Font Size (Does Not Scale)
Unlike em px values remain fixed and do not scale with the parent element.
HTML:
<section>
<p>This text is in fixed pixel size.</p>
</section>
CSS:
section {
font-size: 20px; /* Set font size */
}
p {
font-size: 30px; /* Always 30px, no matter the parent */
}
Result:
- <p> will always be 30px, regardless of the <section> size.
- Unlike em, it does not inherit scaling.
β Use px when you want a fixed, unchanging size.
You can also try vh to px for view height conversions.
Example 2: Consistent Button Size (Does Not Change with Base Font)
When using px, the size of buttons remains constant across different devices.
HTML:
<button class="btn">Click Me</button>
CSS:
.btn {
font-size: 18px; /* Fixed font size */
padding: 10px 20px; /* Fixed padding */
background: blue;
color: white;
border: none;
cursor: pointer;
}
Why Itβs Useful?
- The button remains the same size no matter the user’s settings.
- Best when you need uniform design consistency.