Home Pixels to rem
Pixels to rem
At a root of 16, 16px is 1.0000 rem and 15px is 0.9375 rem. 1px divided by a root of 3 is 0.3333 because the fifth decimal digit is below 5. A root of 0 stops.
Why this exists
A rem is a multiple of the root font size. When the root is 16px, 1 rem is 16px, and the page shows that multiple to four decimal places.
A fifth digit below 5 does not round up. 0.33333… is 0.3333, and 0.66666… is 0.6667.
-
01How to use it
In px to rem, a value of 16 and a root of 16 show 1.0000.
Rem to px multiplies the same root by the value. 1.5 and 16 are 24.0000.
Copy puts that one number on the clipboard. Clearing a field hides the result.
-
02What you get
At a root of 16, 16px is 1.0000, 15px is 0.9375, and 1px is 0.0625.
At a root of 3, 1px is 0.3333 and 2px is 0.6667.
At a root of 16, 1 rem is 16.0000px and 1.5 rem is 24.0000px.
Entered16px
16px, root 16 1.0000 rem 15px, root 16 0.9375 rem 1px, root 3 0.3333 rem 1.5 rem, root 16 24.0000 px -
03Worth knowing
This conversion does not read the live font size of an element. It uses the number in the root field.
An em follows the parent font size, so it can differ from the rem on this page.
A negative and a root of 0 stop. Commas are removed, so 1,000 is 1000.
Closing the tab clears the numbers. Nothing is sent to a server.
Questions
- QHow many rem is 16px?
- AAt a root of 16 it is 1.0000 rem.
- QWhat about 15px?
- AIt is 0.9375 rem. 15÷16 ends exactly at the fourth decimal place.
- QWhat is 1px divided by 3?
- AIt is 0.3333. The fifth digit was below 5, so it did not round up.
- QHow many px is 1.5 rem?
- AAt a root of 16 it is 24.0000px.
How this page works it out
This page converts px and rem with a root font size. Px to rem divides the value by the root. At a root of 16, 16÷16 is 1.0000, 24÷16 is 1.5000, 10÷16 is 0.6250, and 15÷16 is 0.9375. Rem to px multiplies the value by the root. At a root of 16, 1 rem is 16.0000px, 1.5 rem is 24.0000px, and 0.0625 rem is 1.0000px.
The result has four decimal places, and a fifth digit of 5 or more rounds away from zero. 1÷3 is 0.33333…, so it is 0.3333, and 2÷3 is 0.66666…, so it is 0.6667. The value is counted in ten-thousandths and the root in thousandths. At a root of 0.5, 16px is 32.0000 rem. A root of 0 cannot divide and stops.
The value runs from 0 to 100,000 with at most four decimal places. The root is above 0 through 1,000 with at most three decimal places. A negative number and 1,000.001 stop. Commas are removed, so 1,000 is 1000. This conversion does not read an element’s live font size. It uses the number in the root field. An em follows the parent size, so it can differ from the rem on this page. The numbers are calculated only in this browser and are not sent to a server.