StringMash.com

rem to px converter

rem values back to pixels, one at a time or across a whole stylesheet.

Conversion
3 characters
Updates as you type
Paste CSS to convert every rem value in it

Show the steps
  1. px = rem × root font size. The root font size here is 16px.
  2. 1.5rem × 16 = 24px
  3. So 1.5rem is 24px.

Using the converter

Type a rem value, with or without the unit, and the pixels appear on the right. 1.5 gives 24px. Paste CSS and every rem in it changes, while em, percentages and plain numbers like line-height: 1.5 don't.

Comments, quoted strings, url() and @media conditions are left as they are. To go from pixels to rem, press swap or use the px to rem converter, which can also keep 1px borders in pixels.

Common sizes in px

At a root font size of 16px, with 4 decimal places at most.
rempx
0.5rem8px
0.625rem10px
0.75rem12px
0.875rem14px
1rem16px
1.125rem18px
1.25rem20px
1.5rem24px
2rem32px
2.5rem40px
3rem48px
4rem64px

How to convert rem to px

Multiply by the root font size. With the browser default of 16px, 1.5rem × 16 = 24px and 0.875rem × 16 = 14px.

The root is whatever font-size the <html> element ends up with. If a stylesheet uses the 62.5% trick, the root is 10px and 2.4rem is 24px, so set Root font size to 10. A reader who changes their browser's default text size changes the root as well. rem sizes follow them, which is the reason to use rem at all.

Questions

What is 1rem in px?

16px at the browser default root size. It's always the root element's font size, so a stylesheet or a reader's settings can change it.

What is 0.875rem in px?

14px at a 16px root.

Is rem the same as em?

Only at the top of the page. rem always measures from the `<html>` element. em measures from the element's own font size, so it changes as you go deeper into nested elements.

How do I read Tailwind sizes in px?

Tailwind CSS v4 spaces things in steps of 0.25rem, so divide the number by 4 for rem and multiply by 16 for px. `p-6` is 1.5rem, which is 24px.

Sources

Added and reviewed . What's new