Richscripts

PX to REM converter

Convert pixel sizes to rem units for accessible CSS. The base is usually 16px, the browser default.

Private: everything happens in your browser. Nothing you type or choose is uploaded.

px

Common sizes at 16px

PixelsREM

How to use it

  1. Type a pixel value to get rem, or a rem value to get pixels.
  2. Change the base if your root font size is not 16px.
  3. Copy the CSS line or read the table.

Questions and answers

How do I convert px to rem?

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

Why use rem instead of px?

Sizes in rem follow the reader’s browser font setting, so text grows for people who need larger type.

What is the difference between rem and em?

rem is relative to the root (html) font size; em is relative to the font size of the element’s parent, so em values can compound.

Developer tools