PX to REM
This calculator converts pixels to CSS units called REM. The conversion is based on the standard font size of 16 pixels, but this may be changed. You can declare a size relative to the font size of the HTML root tag using the CSS rem unit. Of course, the conversion works in both directions; simply change the opposite input field.
The length of a REM unit is the same across a single document; it can only change between papers. EM can differ between elements since it is relative to the font size of the element (the exception is the font size itself, in which EM is related to the parent).
Because REM is a newer unit, older browsers do not support it.
PX to REM Conversion Table
These are the most common px-to-rem sizes. This assumes that your default font (font size) is 16px. You could try the above converter.
PX | REM |
---|---|
4px | 0.25rem |
8px | 0.5rem |
12px | 0.75rem |
16px | 1rem |
20px | 1.25rem |
24px | 1.5rem |
32px | 2rem |
40px | 2.5rem |
48px | 3rem |
64px | 4rem |
96px | 6rem |
128px | 8rem |
160px | 10rem |
176px | 11rem |
192px | 12rem |
208px | 13rem |
224px | 14rem |
256px | 16rem |
320px | 20rem |
480px | 30rem |
576px | 36rem |
768px | 48rem |
800px | 50rem |
960px | 60rem |
992px | 62rem |
1024px | 64rem |
1120px | 70rem |
1200px | 75rem |
1280px | 80rem |
1440px | 90rem |
1600px | 100rem |
How to Convert PX to REM
The font-size you define on an element is the key to converting a px value to a rem value.
html {font-size: 16px}
The formula can then be used to manually calculate the rem equivalent.
EM to PX Formula
rem = px / base font
Difference Between PX and REM
To know the distinction between px (pixel) and rem (root ems), you need to know what they are and how they operate.
To begin with, they are measures that are utilized on-screen media or displays on various devices. They are units of length that are widely used in CSS (Cascading Style Sheets).
The distinction is that px is a fixed-size unit. If you declare this font is 16px, it is exactly 16px no matter where you put it. It’s only that different devices may show it differently. A 16px font seen on your computer monitor might appear different on your mobile phone.