PX to EM Converter

Use px to em converter locally, without uploading your data.

Loading calculator…

What this tool does

Use px to em converter locally, without uploading your data. Computed font-size context determines the conversion; negative CSS lengths are supported.

How to use the PX to EM Converter

  1. Enter or select pixel value.
  2. Enter or select element font size (px).
  3. Read the calculated result; change any measurement to compare alternatives.

Formula

relative units=px/base font size
value
Pixel value
base
Element font size (px)

Computed font-size context determines the conversion; negative CSS lengths are supported.

Worked example

For px to em converter, the following measurements illustrate the exact method: Pixel value: 16; Element font size (px): 16.

Inputs

  • Pixel value16
  • Element font size (px)16

Result

  • EM1

Results explained

EM
EM from the formula above. Computed font-size context determines the conversion; negative CSS lengths are supported.

Frequently asked questions

relative units=px/base font size

Computed font-size context determines the conversion; negative CSS lengths are supported.

No. Content stays in your browser and no API is called.

Copy the result, review it in your project, and test it in the intended environment.

No. Syntax checks and conversions cannot replace application-specific testing, security review or accessibility review.