Skip to content
ENExplore Calculators

CSS Unit Converter

Free CSS Unit Converter calculator with clear step-by-step results.

About CSS Unit Converter

Every CSS length resolves to a pixel value at render time, so conversion goes through px as the pivot. rem depends on the root font size, em on the parent's computed size, pt on the fixed 96-per-inch CSS reference, and vw on the viewport - which is why the same declaration can mean four different things.

Formulas

rem to px

px = rem x root font size

px to pt

pt = px x 72 / 96

Worked example

With the default values below, CSS Unit Converter returns Pixels of 24.0000. Change any input above and every figure here is recalculated in your browser.

Inputs used

Value to convertminimum -10,000
24
Source unitone of px, rem, em, pt, percent of parent
px
Root font sizeminimum 1 px
16 px
Parent font sizeminimum 1 px
18 px
Viewport widthminimum 100 px
1,440 px

Results

Pixels
24.0000 px
Root-relative
1.5000 rem
Parent-relative
1.3333 em
Viewport width units
1.6667 vw

Step by step

  1. 1Values used
  2. 2rem to px
  3. 3px to pt
  4. 4Pixels= 24.0000 px
  5. 5Root-relative= 1.5000 rem
  6. 6Parent-relative= 1.3333 em
  7. 7Viewport width units= 1.6667 vw

Assumptions and limits

  • The result is derived only from the 5 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 4 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

Should I size text in rem or em?

rem for font sizes, because it stays predictable regardless of nesting. em is useful for spacing that should track the element's own text size, such as margin below a heading.

Is 1pt really 1.333px?

In CSS, yes - the specification fixes 1 inch at 96 px and 1 pt at 1/72 inch. That is a reference unit, not necessarily the physical density of the display.

CSS Unit Converter – Calculate Pixels & Root-relative