May 23, 2026 · 4 min read

How to Convert Pixels to REM in CSS (Free Calculator)

Convert px to rem (and back) with the standard 16px base, plus em, pt, and pc. Free, instant, no sign-up.

Advertisement

Modern CSS leans heavily on rem units for scalable typography. The conversion is simple — divide pixels by 16 — but doing it for a whole stylesheet by hand gets old fast.

The formula

rem = px ÷ root font-size (default 16). So 24px = 1.5rem, 18px = 1.125rem.

Convert any unit instantly

Our Typography Unit Converter (px, em, pt) handles px, em, rem, pt, pc, in, cm, and mm in one place. Paste a value and see all the equivalents.

When to use rem vs em

  • rem scales from the root — predictable across components
  • em scales from the parent — useful for nested padding/margins
  • px stays fixed — fine for borders and shadows
Advertisement

Tools mentioned in this guide

Keep reading