Pixel (px) to Em Converter

Use our px to em converter to convert px to em instantly for responsive typography. Includes pixel to em conversion, a pixel to em calculator explanation, and how to convert px to em in CSS (convert px to em css).

Base size (px)
The base font size in pixels (must be > 0).
Object's size (px)
The element size in pixels.
Results
Is the same as (em)
Computed as em = objectPx / basePx.
em
Is the same as (pt)
Computed as pt = objectPx × 0.75 (assuming 96 px per inch).
pt
Is the same as (%)
Computed as % = (objectPx / basePx) × 100.
%
px → em/pt/% = ?
Did we solve your problem today?

What is Px to Em Conversion?

Px (pixels) and em are common CSS length units. Pixels are fixed units, while em is a relative unit based on the current font size of the element (or its parent, depending on the property).

If you want responsive layouts, converting pixels to em can help your design scale with the user’s font settings and avoid hard-coded sizes.

This pixel to em converter (pixel to em calculator) converts px to em using a base font size you choose, which matches how you convert px to em in CSS.

Px to Em Conversion Formula

To convert px to em, divide the pixel value by the base font size (in px).

Px to em =
em = px ÷ basePx

basePx is usually 16px by default in browsers, but you can set it in CSS.

px
= Pixel value you want to convert
basePx
= Base font size in pixels (often 16px)
em
= Relative CSS unit result
Pixel to em conversion example (16px base)
24px → 24 ÷ 16 = 1.5em

A common CSS conversion when the base font size is 16px.

Px to em conversion CSS example (20px base)
18px → 18 ÷ 20 = 0.9em

If a container uses 20px font size, em values scale from 20px.

How to Use the Px to Em Converter

  1. 1

    Enter the base font size (px).

  2. 2

    Enter the pixel value you want to convert.

  3. 3

    The converter calculates em = px ÷ basePx.

  4. 4

    Use the em value in CSS for scalable typography and spacing.

Frequently Asked Questions

How do I convert px to em?

Divide the pixel value by the base font size: em = px ÷ basePx.

Convert px to em in CSS — what’s the formula?

It’s the same formula: em = px ÷ basePx. If the base is 16px, then 16px = 1em, 32px = 2em, etc.

What is a pixel to em calculator?

A tool that converts pixel values into em units based on a chosen base font size.

What is the default base font size for px to em conversion?

Most browsers default to 16px for the root font size, but your CSS can change it.

Why use em instead of px?

em is relative to font size, which can improve accessibility and responsiveness. px is fixed.

Is this a px to em conversion online tool?

Yes—this px to em converter calculates the em result instantly based on your base size.