CSS px ↔ rem ↔ em Converter

Convert CSS units between pixels, rem, em and points (assuming the default 16px root font size).

🖥️

CSS px / rem / em Converter

Design • CSS units

🖥️
Enter a value to convert

How to Use the CSS px / rem / em Converter

  1. Enter a value — type any number. Invalid text and symbols are blocked automatically.
  2. Select From and To units — choose the units to convert between.
  3. Read the animated result — the converted value, factor, and full reference table update instantly.
  4. Use Swap (⇄) — reverse the conversion in one click.

Why Use This CSS px / rem / em Converter

🎯

px is the reference unit

All 4 units on the CSS px / rem / em Converter are defined against the Pixels (px), so each result is one conversion factor away from a single reference rather than the end of a chain of roundings.

Opens on Pixels → Root em

The conversion this page is most often opened for is ready before you type anything: 1 px = 0.0625 rem. Change either side and every row in the table recalculates with it.

🔒

100% private

Everything runs in your browser — no account, no uploads, nothing leaves your device.

Understanding the CSS px / rem / em Converter

Modern responsive web design mixes CSS units: pixels (px) are fixed, while rem and em scale with font size (1 rem = 16px by default). Converting between px, rem, em and points keeps typography and spacing consistent and accessible across devices.

Front-end developers use this to translate a designer's pixel values into scalable rem/em. Enter any value to see the equivalents, assuming the standard 16px root font size.

The point row exists for print rather than screens, and its factor is fixed by two competing definitions of an inch: 72 points to the inch in typography against 96 CSS pixels to the inch, giving exactly 4/3. That is why 12 pt and 16 px are the same size, and why a stylesheet that mixes the two is not wrong so much as difficult to reason about — the sizes interleave rather than nest.

The critical difference between em and rem is what happens when they nest. A rem always refers to the root font size, so 1.5 rem is the same size wherever it appears. An em refers to the font size of its own element, so a 1.5 em rule applied inside another 1.5 em element compounds to 2.25 times the base — the reason deeply nested lists and menus drift in size for no visible reason. Ems remain the better choice for anything that should scale with its immediate context, such as padding around text, and the worse choice for a type scale.

One widely copied technique deserves a warning. Setting the root font size to 62.5% so that 1 rem equals a convenient 10 px makes the arithmetic easier and quietly overrides the reader's own default text size, which is exactly the preference rem was introduced to respect. Media-query widths written in em are a related special case: they are evaluated against the browser's default font size rather than the root element's, so they keep working even when the root has been altered.

Common CSS px / rem / em Converter Values

Quick reference — 1 Pixels (px) is equal to:

Root emrem0.0625
Emem0.0625
Pointspt0.750000019

Formula & Logic — css px / rem / em conversion

4 units of css px / rem / em, each a fixed multiple of the px. The table spans 16:1, from px (1 px) to em (16 px). Conversion is one multiplication into the base unit and one division out of it, with no lookup table and no approximation.

value_to = value_from × (factor_from ÷ factor_to)1 px = 1 px1 rem = 16 px1 em = 16 px1 pt = 1.33333 px

where:

base unit
px
factor_from
px is the base unit, so this factor is exactly 1
factor_to
1 rem = 16 px
combined
1 px = 0.0625 rem

Assumptions: Factors are exact definitions. Full double precision is carried internally and rounding is applied only for display.

Worked Example: 25 px to rem

  • Value25 px
  • FromPixels (px)
  • ToRoot em (rem)
  • Base unitpx
  1. Into the base unit: 25 × 1 = 25 px.
  2. Out of the base unit: 25 ÷ 16 = 1.5625 rem.
  3. Folded into one constant: 1 px = 0.0625 rem, so the result is smaller than the input.

Result25 px = 1.5625 rem

CSS px / rem / em Converter FAQ

With the default browser root font size of 16px, 1 rem = 16px. So 1.5rem = 24px. Change the root size and rem scales with it.

Related Converters

✔ Written & reviewed by Dr Sam — 20+ yrs in management & research leadership📅 Last updated September 2026📚 Sources: NIST & BIPM SI unit definitions📑 How we build & check these

The CSS Pixel Is a Reference Unit, Not a Hardware One

A CSS pixel has not corresponded to a physical screen pixel for many years. It is a reference unit sized so that content stays legible at a normal viewing distance, which is why a phone reporting 1,170 hardware pixels across presents itself to CSS as roughly 390 pixels wide at a device ratio of 3.

The rem is what makes a layout respond to the reader rather than the designer. It is relative to the root font size — 16 px by default — so a heading set at 2 rem is 32 px normally, but scales automatically for someone who has raised their browser's default text size for readability. Sizing type in px overrides that preference entirely, which is why the px-to-rem conversion is really an accessibility decision wearing an arithmetic costume.