rem = px / root
px to rem converter Rem/Px/Em Absolute Viewport Font-relative Resolution
Start typing a value in any field above.
Copy CSS
Copies the pixels field.
Common sizes
8px · 0.5rem 10px · 0.625rem 12px · 0.75rem 14px · 0.875rem 16px · 1rem 18px · 1.125rem 20px · 1.25rem 24px · 1.5rem 32px · 2rem
Start typing a value.
At the browser default of 16px, 16px is 1rem, 24px is 1.5rem, and 18px is 1.125rem.
A root of 10px is what people mean by 62.5% of 16px. Then 16px is 1.6rem and 24px is 2.4rem. Type 10 in the root field or the page still uses 16. The parent field changes em only.
16 / 16 = 1rem 24 / 16 = 1.5rem 18 / 16 = 1.125rem 16 / 10 = 1.6rem Common px lengths in rem at a 16px root px rem (root 16px) 8 0.5 10 0.625 12 0.75 14 0.875 16 1 18 1.125 20 1.25 24 1.5 32 2
Also see rem to px , em to px , and px to em . The other unit groups are on Units .
Questions How do you convert px to rem? Divide the pixel length by the root font size. rem = px / root. 24px at a 16px root is 1.5rem.
What is 16px in rem? 1rem when the root is 16px. If the root is 10px, 16px is 1.6rem.
What does a 62.5% root change? 62.5% of the usual 16px default is 10px on html. Then rem = px / 10. Type 10 in the root field or this page still uses 16.
Does rem follow the parent? No. rem uses the html font size. The parent field changes em only.