Home โ€บ Developer Tools โ€บ PX to REM Converter

๐Ÿ“ PX to REM Converter

Convert pixels to rem, em, pt and percent (and back) using your project's base font size.

About this PX to REM Converter

Modern CSS favors rem units over pixels because rem scales with the user's root font-size setting, which keeps layouts accessible when people enlarge text. This converter translates pixels into rem, em, points and percent using your base size (16px is the browser default), and converts rem back to pixels when you are reading someone else's stylesheet.

How to use it

  1. Set the base font size โ€” leave it at 16 unless your project changes the root size.
  2. Enter a pixel value and click PX โ†’ units for the full table.
  3. Or enter a rem value and click REM โ†’ PX to go the other way.
  4. Copy the ready-made CSS snippet shown under the table.

Example

At the standard 16px base, 24px converts to 1.5rem, 18pt and 150% โ€” a typical heading size in both worlds.

Frequently asked questions

What is the difference between rem and em?

Rem is always relative to the root (html) font size, so it is predictable. Em is relative to the element's parent, so nested ems multiply โ€” powerful but easy to lose track of.

Why is the default base 16?

Every major browser ships with a 16px root font size unless the user or the site changes it, so 16 is the safe assumption for conversions.

More Developer Tools