PX to REM Converter
Convert pixels (px) to Root em (rem) for responsive web design.
CSS Output
Why Use REM?
REM (Root EM) is a scalable unit in CSS. Unlike pixels (px), which are fixed, REM units scale based on the user's browser font size settings. This improves accessibility and responsiveness.
The Math
REM = Pixels / Base Size
If your base font-size (on the `html` element) is 16px (the browser default):
- 16px = 1rem
- 24px = 1.5rem
- 32px = 2rem
62.5% Trick
Many developers set html { font-size: 62.5%; }. Since 62.5% of 16px is 10px, this makes the math easy (10px = 1rem, 16px = 1.6rem). If you use this trick, set the Root Font Size to 10 above.