Back to Web development

PX to REM converter, both ways, including whole CSS blocks

Set the root size, convert px to rem and back, and see a table of common sizes. Paste a whole CSS block to convert every px to rem, optionally keeping 1px borders.

How to use

  1. Keep the 16 px root size unless your site changes the font size of the html element.
  2. Type a px or rem value and the other box updates.
  3. Paste a CSS block to convert all px to rem, then click Copy.

Frequently asked questions

Why use rem instead of px?

Rem scales with the text size people set in their browser, so readers who need larger text can read more easily.

Should 1px borders be converted too?

Better not. A 1px border in rem can turn blurry or disappear, so leave it as it is.

Where does the 16 px root size come from?

It is the default text size in most browsers. If your site sets html , the root size is 10 px.