Image & screen

CSS Unit Converter

Convert common CSS lengths only when their required context is explicit. Supply root and current element font sizes so rem and em do not silently assume the same basis.

● Runs locally
Example values
Runs in your browser · No account required

CSS Unit Converter

Converted CSS length
01

Formula

1rem = root px · 1em = element px · 1pt = 96/72 px

Normalize the source unit to CSS reference pixels, then divide by the target unit’s contextual pixel factor.

02

Assumptions

  • Root and element font sizes are strictly positive.
  • The CSS reference pixel is used rather than a measured physical screen pixel.

This tool assumes the CSS reference relation 1in = 96px and 1pt = 1/72in. Viewport units and percentages are excluded.

03

Formula review

Formula v1.0.0

Reviewed 2026-08-03

CalcFlow engineering review

Worked example

CSS Unit Converter: Worked example

At a 16 px root, 24 px ÷ 16 = 1.5 rem. Under the reference-pixel rule, 24 px also equals 18 pt.

Frequently asked questions

Frequently asked questions

What is the difference between rem and em?

rem uses the root element font size. em uses the current element’s font-size context.

Why are percentages excluded?

A percentage can depend on different properties and containing blocks, so one scalar context is not sufficient.

Is a CSS px a physical pixel?

Not necessarily. CSS defines a reference pixel that browsers map to device pixels according to display and zoom.