Ready now
PX <-> REM / EM Converter
Preparing controls…
About this tool
What PX <-> REM / EM Converter does
Convert CSS pixel, rem, and em values using an explicit root or element font-size base.
Convert CSS px, rem and em values using separate root and element font-size bases. A rem uses the root base; an em uses the selected element base in this calculation.
Convert spacing at a 16px root
Input or settings
Value: 24 From: px To: rem Root font size: 16 px Element font size: 20 px
Expected result
24 px = 1.5 rem Pixel equivalent: 24 px
How to use it
- Enter the value and choose source/destination units.
- Set the root and element bases in CSS pixels, then choose Convert length.
- Compare the pixel equivalent with the actual computed font sizes in your page.
Common uses
- Translate a 24px spacing value into rem units.
- Compare em and rem sizing when a component uses a different font size.
Important limitations
- CSS pixels are not physical screen pixels; device pixel ratio is outside this conversion.
- The em base is explicitly supplied, not discovered from a DOM element, and real CSS properties may resolve em differently.
Frequently asked questions
Why are root and element bases separate?
rem is relative to the root font size, while em normally depends on the relevant element font size.
Will this predict the browser’s computed layout?
It calculates the chosen ratio only. Inheritance, zoom, property-specific rules and the cascade must be checked in the actual page.