px to rem Converter
Convert px to rem and rem to px for any root font size, with a live CSS conversion table.
Browser default: 16px.
px → rem
24 ÷ 16 = 1.5rem
rem → px
2 × 16 = 32px
Conversion table
| px | rem | CSS |
|---|
How it works
A rem is simply a multiple of the root font size, so converting px to rem is
one division: rem = px ÷ root font size. With the browser default of 16px,
24px becomes 1.5rem and 14px becomes 0.875rem. Type in either box above and the other side
updates instantly — px to rem on the left, rem to px on the right — and the conversion table
below rebuilds for whatever root font size you set, so it still works if your CSS uses a
10px or 62.5% root. Using rem for font sizes, spacing and media queries means your layout
scales when a visitor bumps their browser's default text size, which px values ignore.
Everything is calculated in your browser with JavaScript — nothing is uploaded and there
are no ads.
Frequently asked questions
How do I convert px to rem?
Divide the pixel value by the root font size: rem = px ÷ root font size. With the browser default of 16px, 24px ÷ 16 = 1.5rem and 14px ÷ 16 = 0.875rem. If your CSS sets a different font-size on the html element (a 10px or 62.5% root, for example), change the root font size field above and every result and table row recalculates for it.
What is 16px in rem?
16px is exactly 1rem when the root font size is the browser default of 16px, because 1rem always equals the font size of the html element. On a 10px root, 16px would be 1.6rem instead — which is why the root font size is an input on this converter rather than a fixed assumption.
How do I convert rem back to px?
Multiply instead of divide: px = rem × root font size. So 2rem × 16 = 32px and 0.5rem × 16 = 8px. Use the rem to px side of the converter above to do it instantly, and copy the result straight into your CSS or design tool.