Why use rem?
Rem units respect the user's browser font-size preference. Px units do not. Using rem improves accessibility for users with visual impairments.
Developer tools
Convert between px and rem for CSS with any base font size.
Complete guide
Enter a pixel or rem value and the base font size (default 16px). The converter shows the equivalent in the other unit and the CSS declaration you can paste into your stylesheet.
Rem units are relative to the root element font size. Using rem instead of px makes layouts scale correctly when users change browser font size — important for accessibility.
Rem units respect the user's browser font-size preference. Px units do not. Using rem improves accessibility for users with visual impairments.
Browsers default to 16px root font size. 1rem = 16px at default settings. Change the base if your CSS sets a different root font size.
Rem is relative to the root element. Em is relative to the parent element. Rem is more predictable for layout; em is useful for component-scoped scaling.
Answers
Divide the pixel value by the base font size. At 16px base: 24px / 16 = 1.5rem.
Multiply rem by the base font size. 1.5rem x 16px = 24px.
16px in most browsers, unless the site overrides it with a root font-size CSS rule.
Rem scales with the user's browser font size preference, making your layout more accessible.
At the default 16px base, 1rem = 16px.
Related tools