REM to PX converter
Enter a value, choose px or rem, and set the root font size; the tool converts both ways and shows the result at common root sizes.
At common root sizes
| Root | px | rem |
|---|
Questions and answers
Is 1rem always 16px?
Only when the root font size is 16px. 1rem equals the root font size, which the browser sets to 16px by default but the reader can change. That is the point of rem: spacing and text follow the reader's setting.
When should I use px instead of rem?
Use px for things that should not scale with text: 1px borders, hairlines, and shadows tied to a physical pixel. Use rem for spacing, font sizes and layout widths that should follow the reader's text size.
Should I set html font-size to 62.5%?
Avoid it. The 62.5% trick makes 1rem equal 10px for easier math, but it overrides the reader's font size preference and makes every rem value depend on that hack. Keep the root at the browser default and use 0.625rem when you need 10px.
What happens if the reader changes their default font size?
Every rem value scales with it, while px values stay fixed. A layout built on rem keeps its proportions; one built on px gets cramped or leaves gaps. This is why a rem-based spacing scale is the accessible default.
Last updated