About this tool
Convert between pixels, rem and em using your own root and parent font sizes, with a reference table of common values. Paste a CSS snippet to turn every px value into rem in one go, while 1px hairlines are kept as they are.
How to use PX to REM Converter
- Set the root font size (16px by default).
- Type a value in px, rem or em.
- Use the table for quick lookups.
- Paste CSS to convert all px values at once.
Frequently asked questions
What is the difference between rem and em?
rem is relative to the root html font size, so it is the same everywhere. em is relative to the current element's font size, so it compounds when nested.
Why keep 1px borders in px?
Thin borders converted to rem can become blurry or vanish at some zoom levels. Leaving hairlines in px keeps them crisp.