🎨 CSS Unit Converter

PX to REM Converter

Convert pixels (px) to rem and rem to pixels side by side. Change the root font size, convert multiple pixel values, and copy results for your CSS stylesheet.

🔒 All calculations run locally in your browser.
px
The common browser default is 16px.
Result in rem
1.5rem
Result in pixels
24px

Convert multiple px values to rem

Enter pixel values separated by commas, spaces, or new lines. Results use the root font size above.

PixelsREM
Converting sample values…

How to convert px to rem and rem to px

With a root font size of 16px, divide a pixel value by 16 to get rem. For example, 8px ÷ 16 = 0.5rem. To convert in the other direction, multiply the rem value by the root font size: 1rem × 16 = 16px. If your project uses a different root font size, change the setting in the converter and the results will update.

rem = px ÷ root font size
px = rem × root font size

PX to REM conversion examples (16px root)

These common conversions use a root font size of 16px. Values are rounded only when necessary.

PixelsEquivalent remExample use
4px0.25remTiny gaps or details
6px0.375remCompact spacing
8px0.5remSmall padding
10px0.625remSmall text or gaps
12px0.75remSmall text or padding
14px0.875remCompact body text
16px1remDefault text size
18px1.125remLarger body text
20px1.25remSubheadings
24px1.5remHeading or gap
28px1.75remMedium heading
32px2remSection spacing
40px2.5remLarge gap
48px3remLarge heading or spacing
64px4remWide spacing

REM to PX examples (16px root)

REMEquivalent pixels
0.25rem4px
0.5rem8px
0.75rem12px
1rem16px
1.125rem18px
1.25rem20px
1.5rem24px
2rem32px
2.5rem40px
3rem48px
4rem64px

Why use rem units in CSS?

Rem units are relative to the root element's font size, which can make typography and spacing scale consistently when that base size changes. Pixel units can still be useful for fixed details such as thin borders. Check the root font size used by your project before relying on a conversion table, because a custom root size changes every px-to-rem and rem-to-px result.