PX to REM Converter

Convert CSS pixels and rem units both ways.

px
px
rem

Quick conversion table

PixelsREM

PX to REM and REM to PX converter

Convert CSS pixel and rem values in either direction. Change the root font size to match your project, type in either field, and the other value updates instantly. The generated reference table is useful when translating a design system or checking common spacing and typography sizes.

PX and REM formulas

To convert pixels to rem, divide pixels by the root font size. To convert rem to pixels, multiply rem by the root font size. For example, with a 16px root, 20px is 1.25rem and 1.5rem is 24px.

Why designers use REM units

REM values share one root reference, which helps type and spacing scale consistently and respect user font preferences. A browser often starts at 16px, but that value is not guaranteed, so this converter lets you use any positive root size rather than assuming a fixed base.

Frequently asked questions

How do I convert pixels to rem?

Divide the pixel value by the root font size. With the common 16px root size, 24px ÷ 16 equals 1.5rem.

How do I convert rem to pixels?

Multiply the rem value by the root font size. At a 16px root size, 2rem equals 32px.

What does rem mean in CSS?

The rem unit is relative to the computed font size of the document root element. This makes spacing and typography scale consistently from one shared base.

Is the root font size always 16px?

Browsers commonly default to 16px, but users and websites can change it. Enter the root size used by your design to get the correct conversion.

Should I use px or rem?

Use rem when a value should scale with the root font size, especially typography and layout spacing. Pixels can still be useful for fine visual details such as one-pixel borders.