PX to REM Converter
Convert CSS pixels to rem units and back, using your base font size.
Inputs
Result
About the PX to REM Converter
A rem is relative to the font size of the root element, which is the html element in a web page. With the browser default of 16px, 1rem equals 16px, so 24px equals 1.5rem. Changing the base font size changes the conversion, which is why this tool asks for it.
Rem units scale with user preferences. If a visitor increases their default text size in the browser, rem-based layouts grow with it, while fixed pixel values stay the same. That makes rem a common choice for font sizes, spacing and component dimensions in accessible design.
Common questions about PX to REM Converter
How do I convert px to rem?
Divide the pixel value by the base font size. For example, 24 divided by 16 gives 1.5rem.
What base font size should I use?
Most sites use the browser default of 16px. If your stylesheet sets a different size on the html element, enter that value instead.
What is the difference between rem and em?
Rem is based on the root font size, so it is the same everywhere. Em is based on the font size of the parent element, so it compounds when nested.