Tools

Home
JSON FormatterSQL FormatterJS ValidatorMinify CSS
Merge PDFCompress PDFImage to PDF
JPG to PNGPNG to WebPCrop Image

EM to Pixel Calculator

Convert em units to pixel values based on parent font size, with batch conversion and CSS output

Your files never leave your browser
px
em
↔
px
1em × 16px = 16px
EM Values (one per line)0 values
Pixel Results0 values
CSS Input (with em values)
CSS Output (with px values)
Ready·Formula: px = em × parent font size

Quick Reference Table

Common em-to-pixel conversions at 16px parent font size:

EMPixelsCommon 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

Enter EM Value
→
Multiply by Parent px
→
Get Pixel Result

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.

INPUT
0.75em (parent: 16px)
OUTPUT
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.

INPUT
1.25, 1.5, 1.75, 2, 2.5, 3 (parent: 18px, batch mode)
OUTPUT
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.

INPUT
.card { padding: 1.5em 2em; margin-bottom: 1.25em; font-size: 0.875em; }
OUTPUT
.card { padding: 24px 32px; margin-bottom: 20px; font-size: 14px; }

Who Uses This

👨‍💻 Front-End Developers

Converting em-based design tokens to pixel values during implementation.

🎨 UI Designers

Checking that their em spacing values actually produce the pixel sizes they intended in mockups.

📚 Students

Learning how relative CSS units work by seeing the math broken down step by step.

🔧 QA Engineers

Verifying that rendered element sizes match the spec when the codebase uses em units.

Common Mistakes

Assuming the parent is always 16px

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.

Forgetting em values compound when nested

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.

Mixing up em and rem in the conversion

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

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.

Share: