How to use it
- 1
Enter the root font size.
- 2
Enter a px or rem value.
- 3
Read the equivalent value in the other unit.
What the tool can do
- px divided by root size equals rem.
- rem multiplied by root size equals px.
- Decimal numeric values.
Common use cases
- Translating design dimensions into relative CSS units.
- Checking a value with a non-default root font size.
- Converting rem back to pixels for comparison with a design.
How it works inside
1rem equals the computed font size of the root html element.
16 px is common but is not mandatory for every project.
Questions and answers
How do I convert pixels to rem correctly?
Enter the pixel size and your site's root font size. For example, with a 16 px base, 24 px equals 1.5 rem. A different base produces a different result.
Why does the calculated size look different on my site?
Check the page's root font size and browser settings. rem depends on the root font size, while em depends on the relevant font-size context. The calculator uses the base you enter; it does not read your site's styles.
