Pixel to REM Converter
Convert px to rem and rem to px. Set a custom base font size and get bulk conversions for all your CSS values.
Common Conversion Reference
| Pixels (px) | REM (base 16px) | Usage |
|---|
Bulk Convert Multiple Values
Frequently Asked Questions
REM = px ÷ base font size. With the default 16px base: 24px ÷ 16 = 1.5rem. If you change the base to 10px (a common trick), then 24px = 2.4rem.
REM units respect the user's browser font-size preferences, making your design more accessible. Pixels are absolute and override user settings. WCAG accessibility guidelines encourage using relative units for text sizing.
Setting
html { font-size: 62.5%; } makes 1rem = 10px, simplifying math. Then 16px = 1.6rem, 24px = 2.4rem. Set base to 10 in this tool to use this approach.Use REM for font sizes and global spacing — it's always relative to the root, so no compounding issues. Use EM for component-level spacing that should scale with its parent's font size.