Pixels to EM Converter | Responsive CSS Tool

Pixels to EM Converter

⇄
1.000 em
Formula: Pixels ÷ Base Size = EM

About the Pixels To Em Converter

Pixels are fixed. An element set to 24 pixels is 24 pixels on every screen, no matter what the reader has chosen in their browser settings. Em units are relative: 1 em equals the font size of the parent element, so text and spacing set in em scale up or down with the reader’s preferences. That is why designers who care about accessibility and responsive layouts convert pixel values into em before writing their CSS.

The conversion itself is a single division. Take the pixel value and divide it by the base font size: em equals pixels divided by base. With the standard browser default of 16 pixels, 24 pixels becomes 1.5 em, and 32 pixels becomes 2 em. Change the base and the answer changes with it, which is why this converter lets you set the base font size instead of assuming one.

The converter works in both directions. Enter a pixel value to get em, or enter an em value to get pixels back, using the same base. That makes it useful both when you are writing fresh CSS and when you are reading someone else’s stylesheet and want to know what an em value means in pixels.

How to use

  1. Enter the pixel value you want to convert, for example 24.
  2. Set the base font size. The default is 16 pixels, which is the standard browser default.
  3. Read the result instantly: em equals pixels divided by the base font size, so 24 pixels at a base of 16 gives 1.5 em.
  4. To convert the other way, enter an em value and read the pixel result: pixels equal em multiplied by the base font size.
  5. Copy the result and paste it into your stylesheet.

Key features

  • Converts both ways, pixels to em and em to pixels, with the same base font size.
  • Adjustable base font size, so conversions stay correct when a project uses a different root size.
  • Instant results as you type, with no button to press and no page reload.
  • Uses the standard formula, em equals pixels divided by base, so the numbers match what your CSS will do.
  • Runs entirely in your browser, with no sign-up and nothing uploaded.

Common uses

Use it when you are turning a design mockup measured in pixels into accessible CSS, when you are setting font sizes, line heights, padding, or margins that should scale with the reader’s settings, and when you are checking a stylesheet written in em and want the pixel equivalent. It is also handy when learning CSS, since converting a few familiar sizes makes the relationship between the two units concrete.

Frequently asked questions

What is 1em in pixels?

1em equals the font size of the parent element — at the default 16px parent, 1em = 16px.

Why use em instead of px?

Pixels are fixed and absolute; em units scale with the user's font settings, so layouts adapt better to accessibility preferences and different screens.

Do em values compound when nested?

Yes — each nested element measures em against its own parent, so nested em font sizes multiply; rem avoids this by always referring to the root.

How do I convert pixels to em?

Enter the pixel value you want to convert, for example 24px, and set the base font size. The tool divides the pixels by the base size, so 24px divided by 16 gives 1.5em.

Can I convert em back to pixels?

Yes, the reverse calculation multiplies the em value by the base font size. That gives you the pixel size again, which is useful when you are checking a value in existing CSS.

What is the default base font size, and can I change it?

The default base font size is 16px, which is the standard browser default. You can change it if your project uses a different root size, such as 10px with the common 62.5 percent pattern.

When should I use em for spacing and not just for font size?

Use em for padding and margins when you want the spacing to grow or shrink together with the text. That keeps the proportions of a design steady when a reader changes their font size.

Do I need to know CSS to use the converter?

No, you only need to type in the numbers and read the result. The converted value is ready to paste into your stylesheet or your design notes.

Free to use, no signup needed. This tool runs entirely in your browser — your data never leaves your device.