PX to REM Converter
Convert pixels to rem and back, with your own root font size.
How it works
Browsers set the root font size at 16 pixels by default and 1 rem equals that size. Divide pixels by the root size to get rem, or multiply rem by it to get pixels. Change the root size if your page sets html { font-size } to something else.
The formula
rem = px / root size
Worked example
24px at a 16px root is 24 / 16 = 1.5rem. 2rem at a 16px root is 32px.
Good to know
- Use rem for font sizes and spacing so the page scales when a user raises their browser text size.
- rem is relative to the root. em is relative to the parent element, so it compounds when nested.
- A common trick is html { font-size: 62.5% } which makes 1rem equal 10px, but it changes the default for everything.
Common questions
- What is the difference between rem and em?
- rem uses the root size. em uses the current element or its parent.
- What is 16px in rem?
- 1rem with the default root size.
- Should I use px or rem?
- rem for text and layout that should scale, px for hairlines like 1px borders.
More in Utilities.
Add or Subtract Days
Find the date that is some days, weeks, months, years or working days from a date, and see the weekday and week number.
OPEN →Age CalculatorYour exact age in years, months and days, the day you were born, your next birthday, and the age gap with another person.
OPEN →Area ConverterConvert square metres, square feet, acres, hectares and more.
OPEN →