How many px is 1rem?
16px by default. A rem is the root font size of the document, and browsers ship with a 16px root, so 1rem = 16px until a stylesheet changes html { font-size }.
To convert px to rem, divide the pixel value by the root font size: at the browser default of 16px, 24px = 1.5rem and 12px = 0.75rem. Enter any value and base below, or switch to rem → px.
1.5rem at a 16px base
font-size: 1.5rem;Conversion table (base 16px)
| Pixels | REM |
|---|---|
| 1px | 0.0625rem |
| 2px | 0.125rem |
| 4px | 0.25rem |
| 6px | 0.375rem |
| 8px | 0.5rem |
| 10px | 0.625rem |
| 12px | 0.75rem |
| 14px | 0.875rem |
| 15px | 0.9375rem |
| 16px | 1rem |
| 18px | 1.125rem |
| 20px | 1.25rem |
| 24px | 1.5rem |
| 28px | 1.75rem |
| 30px | 1.875rem |
| 32px | 2rem |
| 36px | 2.25rem |
| 40px | 2.5rem |
| 48px | 3rem |
| 56px | 3.5rem |
| 64px | 4rem |
| 72px | 4.5rem |
| 80px | 5rem |
| 96px | 6rem |
| 128px | 8rem |
| Pixels | REM |
|---|---|
| 1px | 0.0625rem |
| 2px | 0.125rem |
| 4px | 0.25rem |
| 6px | 0.375rem |
| 8px | 0.5rem |
| 10px | 0.625rem |
| 12px | 0.75rem |
| 14px | 0.875rem |
| 15px | 0.9375rem |
| 16px | 1rem |
| 18px | 1.125rem |
| 20px | 1.25rem |
| 24px | 1.5rem |
| 28px | 1.75rem |
| 30px | 1.875rem |
| 32px | 2rem |
| 36px | 2.25rem |
| 40px | 2.5rem |
| 48px | 3rem |
| 56px | 3.5rem |
| 64px | 4rem |
| 72px | 4.5rem |
| 80px | 5rem |
| 96px | 6rem |
| 128px | 8rem |
A rem is the root font size of the document. The conversion is one division in each direction:
rem = px ÷ root font size px = rem × root font size 24px at a 16px base → 24 ÷ 16 = 1.5rem 1.5rem at a 16px base → 1.5 × 16 = 24px
If a stylesheet sets html { font-size } to something other than the 16px browser default, that value becomes the base and every rem in the document scales with it.
Use rem for text and spacing that should respect the visitor's browser font-size setting; it is the accessible choice because it scales with the user's preference. Use px for borders, hairlines and other one-pixel details that should not scale.
Pair the converter with fluid type and real font combinations.
16px by default. A rem is the root font size of the document, and browsers ship with a 16px root, so 1rem = 16px until a stylesheet changes html { font-size }.
Divide the pixel value by the root font size: 14 ÷ 16 = 0.875rem at the browser default. At a different base, use the same formula with that base, for example 14 ÷ 10 = 1.4rem.
Yes, when html font-size is not fixed in px. rem units scale with the visitor's browser font-size setting, which is why rem is the accessible choice for text. If a stylesheet pins html { font-size } to a pixel value, rem no longer tracks the setting.