Skip to content

REM ⇆ PX Converter

Convert rem to pixels for any root font size. Type a rem value, keep the root at 16px (the browser default) or change it to match your CSS, and the tool shows the exact pixel value.

REM ⇄ PX Converter
With root 16px → 1 rem = 16 px

How to convert REM to PX

px = rem × root font size

The root font size is the font size of the html element. Examples with the default 16px root:

				
					1rem × 16 = 16px
1.5rem × 16 = 24px
0.875rem × 16 = 14px
				
			

If your site sets html { font-size: 62.5%; }, the root becomes 10px, so 1.5rem = 15px.

REM to PX conversion table

REMPX (root 16px)PX (root 10px)
0.125rem2px1.25px
0.25rem4px2.5px
0.375rem6px3.75px
0.5rem8px5px
0.625rem10px6.25px
0.75rem12px7.5px
0.875rem14px8.75px
1rem16px10px
1.125rem18px11.25px
1.25rem20px12.5px
1.5rem24px15px
1.75rem28px17.5px
2rem32px20px
2.5rem40px25px
3rem48px30px
4rem64px40px

REM vs PX: when to use each

Use rem for font sizes, spacing and layout widths. Rem scales with the user’s browser font setting, so text stays readable for people who need larger type.

Use px for things that should stay crisp and fixed: 1px borders, hairline dividers, box-shadow offsets and small icons that must align to the pixel grid.

Rem is always relative to the root, so it does not compound inside nested elements. That is the main difference from em, which depends on the parent. Need that conversion? Use the EM to REM converter.

Common REM to PX mistakes

  • Assuming the root is always 16px. Check your CSS reset or theme. A 62.5% or 18px root changes every result.
  • Setting the root in px. html { font-size: 16px; } overrides the user’s browser setting. Use a percentage instead, such as 100% or 62.5%.
  • Expecting media queries to follow your root. A breakpoint of 48rem is 768px based on the browser default, even if you changed the html font size.
  • Rounding too early. 0.9375rem is exactly 15px. Rounding it to 0.94rem gives 15.04px and can cause 1px misalignment.

Frequently asked questions

How many pixels is 1rem?

1rem equals the root font size. Browsers use 16px by default, so 1rem = 16px unless your CSS changes the font size of the html element.

What is the formula to convert rem to px?

Multiply the rem value by the root font size: px = rem × root font size. For example, 2.5rem × 16 = 40px.

What does html { font-size: 62.5% } do?

It sets the root font size to 10px (62.5% of 16px), so 1rem = 10px and 1.6rem = 16px. It makes mental math easier, but you must set body text back to 1.6rem.

Should I use rem or px for font sizes?

Use rem for font sizes. Text set in rem grows when a user raises the default font size in browser settings. Text set in px ignores that setting.

Do rem values in media queries use my html font size?

No. In media queries, rem and em are based on the browser’s initial font size (usually 16px), not the font size you set on the html element.

What rem values does Tailwind CSS use?

Tailwind’s default type and spacing scales use rem. text-base is 1rem (16px), and each spacing step is 0.25rem (4px), so p-4 = 1rem = 16px.

Related CSS unit converters