How to use the PX to REM converter
- Enter pixels or rem; the other field updates.
- Change the root size if your project overrides 16px.
- Copy values from the table.
When to use rem
Use rem for font sizes and often for spacing, so layouts respond when someone enlarges their default text size. Hairline borders are usually fine in px.
Frequently asked questions
What is the default root font size?
16px in common browsers, unless the user or your CSS changes it.
What is the difference between rem and em?
rem is relative to the root element; em is relative to the current element's font size.
Should I set html to 62.5%?
It makes 1rem equal 10px by default, but can surprise third-party components.