How to use this tool
- Choose whether the input is px or rem.
- Enter the value and the document root font size.
- Inspect and copy the result alongside its multiplication or division base.
Example input and result
- Input and settings
- 24px; root 16px
- Result
- 1.5rem
rem uses the root element
rem refers to the document root element’s font size, unlike em which can depend on an ancestor. Enter the actual CSS root value rather than assuming a browser default.
Display rounding and CSS application
Results show up to six decimal places without redundant trailing zeros. Negative inputs can represent uses such as negative margins, but whether a negative length is allowed depends on the CSS property.
Common questions
Does this also convert screen resolution and DPR?
Only the CSS unit base changes. Physical pixels, devicePixelRatio and browser zoom are not calculated, so actual display size can vary.