px to em converter

Convert px to em for any base font size. The output updates as you type, with a reference table covering common values.

px

Try 16, 24, 1.5

1
em

Updates as you type

px

Default 16px — change to match your project.

8px0.5em
12px0.75em
14px0.875em
16px1em
18px1.125em
20px1.25em
24px1.5em
32px2em
48px3em
64px4em

How to use this tool

  1. 1Enter the px value you want to convert.
  2. 2Set your project’s base font size (defaults to 16px).
  3. 3Read the em equivalent and copy it for your stylesheet.

About this tool

em is relative to the parent element’s font size. It’s useful inside components when you want spacing or sizing to scale with local typography rather than the root. With a default 16px parent, 1em = 16px.

Related tools

FAQ

Frequently asked questions

What base font size does this converter use?

The default is 16px, which is the browser default for the root `html` element. You can change the base in the input below to match your project (for example, some designs use 10px so 1rem = 10px).

Why use em instead of px?

em is relative to the parent element. It’s great inside components where you want internal spacing to scale with local typography.

Is the conversion exact?

Yes. With the base font size you specify, the conversion is a simple multiplication or division. The math is the same as what your browser does at runtime.

Does this work offline?

Conversion runs entirely in your browser. No values are sent anywhere, and once the page loads, it works offline.

Reviewing work with your team?

Pin comments directly on a live website or design — no extension, no setup.

Annotate live sites and screenshotsCapture browser, viewport, and CSS contextFree for your first project