PX to REM Converter
Convert CSS pixel values to rem (and em), or rem back to pixels, using your project’s root font size — 16px by default.
How to use the PX to REM Converter
- Choose px → rem or rem → px.
- Enter the value.
- Set the root font size if it is not 16px.
How it works
rem = px ÷ root font size. With the browser default of 16px, 24px = 1.5rem and 12px = 0.75rem. Using rem for font sizes and spacing respects the user’s browser font-size setting, which improves accessibility. em works the same way but is relative to the parent element’s font size, so nested em values compound.
px to rem at 16px base
| px | rem | px | rem |
|---|---|---|---|
| 8 | 0.5 | 24 | 1.5 |
| 10 | 0.625 | 28 | 1.75 |
| 12 | 0.75 | 32 | 2 |
| 14 | 0.875 | 36 | 2.25 |
| 16 | 1 | 40 | 2.5 |
| 18 | 1.125 | 48 | 3 |
| 20 | 1.25 | 64 | 4 |
Frequently asked questions
How many px is 1rem?
16px with the default root font size.
What is 24px in rem?
1.5rem at a 16px base.
Should I use rem or px?
rem for font sizes and most spacing, so text scales with user settings; px is fine for borders and hairlines.
What is the difference between rem and em?
rem is relative to the root element; em is relative to the current element’s parent font size.