MyCalCute
Install
Calculators / Technology / Pixels and rem conversion

Pixels and rem conversion calculator

Express a CSS pixel size in rem using the actual root font size.

On this page

Your result

Size in rem1.5rem
Root-relative percentage150%

Calculator controls

How to calculate

Pixels and rem conversionA 24 px size at a 16 px root is 1.5 rem. Changing the root while keeping rem fixed changes the rendered CSS size. Concept diagram; not to scale.Pixels and rem conversionAaAaCSS size (px)24Root font size(px)16Size in rem1.5 remMyCalCute.com
A 24 px size at a 16 px root is 1.5 rem. Changing the root while keeping rem fixed changes the rendered CSS size. Concept diagram; not to scale.

Express a CSS pixel size in rem using the actual root font size.

Size in rem = pixels/root rem
Root-relative percentage = pixels/root*100 %

Worked example

  • CSS size (px): 24
  • Root font size (px): 16
  • Size in rem: 1.5 rem
  • Root-relative percentage: 150 %

Assumptions and limits

CSS pixels are layout units, not device pixels. The root size is supplied by you; browser preferences and styles may change it.

Results are rounded for display; calculations use unrounded values. Read our calculation methodology.

Understanding the result

Express a CSS pixel size in rem using the actual root font size. A 24 px size at a 16 px root is 1.5 rem. Changing the root while keeping rem fixed changes the rendered CSS size.

When this tool is useful

A 24 px size at a 16 px root is 1.5 rem. Changing the root while keeping rem fixed changes the rendered CSS size.

Understanding your inputs

InputExample
CSS size (px) pixels24
Root font size (px) root16

Frequently asked questions

What assumptions should I check?

CSS pixels are layout units, not device pixels. The root size is supplied by you; browser preferences and styles may change it.

How can I check the result?

Start with the labelled example. Keep units consistent, calculate without intermediate rounding and change one input at a time. The diagram explains the model; the result table supplies the numerical answer.