EM to Pixel Calculator
Convert em units to pixel values based on parent font size, with batch conversion and CSS output
Quick Reference Table
Common em-to-pixel conversions at 16px parent font size:
| EM | Pixels | Common Use |
|---|
Convert any em value to pixels by setting the parent font size and typing the number. Single values, batch lists, or full CSS stylesheets — pick a mode and get pixel results instantly. And everything runs in your browser. Nothing gets uploaded.
How It Works
The formula is dead simple: pixels = em × parent font size. If the parent is 16px and you have 1.5em, that's 1.5 × 16 = 24px. The tricky part is remembering which parent font size applies — em units inherit from the nearest parent, not the root. This calculator handles the math so you don't have to keep a scratch pad open.
Examples
Button Padding at Default Base
You're styling a button component and want to know the actual padding in pixels.
0.75em (parent: 16px)
12px
Heading Sizes with Custom Parent
A design system sets the body text to 18px. You need pixel values for all heading levels at once.
1.25, 1.5, 1.75, 2, 2.5, 3
(parent: 18px, batch mode)
22.5px, 27px, 31.5px,
36px, 45px, 54px
Rewriting a Stylesheet Snippet
You inherited a CSS file where everything is in em units. The client wants pixel values so their developers can work faster. Paste the CSS into the CSS mode and get it rewritten automatically.
.card {
padding: 1.5em 2em;
margin-bottom: 1.25em;
font-size: 0.875em;
}
.card {
padding: 24px 32px;
margin-bottom: 20px;
font-size: 14px;
}
Who Uses This
Converting em-based design tokens to pixel values during implementation.
Checking that their em spacing values actually produce the pixel sizes they intended in mockups.
Learning how relative CSS units work by seeing the math broken down step by step.
Verifying that rendered element sizes match the spec when the codebase uses em units.
Common Mistakes
16px is the browser default, but if any ancestor element changes the font size, the em calculation uses that new value instead. Always check what the actual parent font size is before converting.
A div at 1.2em inside another div at 1.2em doesn't give you 1.2 × 16 = 19.2px on the inner div. It gives you 1.2 × 19.2 = 23.04px. Each nesting level multiplies, not adds. This is the number one reason people switch to rem for font sizing.
Em is relative to the parent element's font size. Rem is relative to the root (<html>) font size. If you're converting rem values, set the parent to whatever the root font size is — usually 16px unless you've changed it.
Technical Details
- Processing: 100% client-side — nothing sent to a server
- Browser Support: Chrome, Firefox, Safari, Edge
- Modes: Single value, batch (comma/newline separated), full CSS rewrite
- Precision: Results rounded to 4 decimal places
- Offline: Works without an internet connection
Frequently Asked Questions
What is an em unit in CSS?
An em is a relative size unit that equals the font size of the parent element. So if the parent's font size is 16px, 1em = 16px, 2em = 32px, and so on. The name comes from the old typographic measurement based on the width of the capital letter M.
How do you calculate em to px?
Multiply the em value by the parent font size in pixels. That's it. If you have 1.5em and the parent font size is 16px, you get 1.5 × 16 = 24px. The parent font size is the key variable — change that, and all your pixel values shift.
What is the default browser font size?
Every major browser — Chrome, Firefox, Safari, Edge — defaults to 16px. Users can change this in their browser settings, and you can override it with CSS on the html or body element. But unless someone specifically changed it, 16px is a safe assumption.
What is the difference between em and rem?
Em is relative to the parent element's font size. Rem is relative to the root element's font size (the <html> tag). The big difference: em values compound when nested, rem values don't. Most developers now use rem for font sizes and em for component-level spacing like padding.
Is this em to pixel converter free?
Yes, completely free with no limits. All the math runs in your browser using JavaScript — nothing gets uploaded or stored anywhere. You can run it offline, use it as many times as you want, and there is no signup required.