🔍

🖥️ Px to Em Converter

Convert a pixel (px) value into em units for CSS, based on a chosen base font size.

1
px
2
px

What is an Em Unit?

In CSS, an em is a relative unit of measurement equal to the current element’s font size. Unlike pixels, which are a fixed size, em units scale relative to their context, making them useful for responsive, accessible typography and spacing.

How the Conversion Works

To convert pixels to em, divide the pixel value by the base font size (the font size of the parent element, or the browser default of 16px if unset). This calculator also shows the equivalent in rem units, which are always relative to the root (html) element’s font size, typically 16px.

  • em = pixels ÷ base font size
  • rem = pixels ÷ root font size (usually 16px)

This tool is intended for general web development and educational reference.

Last reviewed August 2026