2 rem equals 32 pixels (px) assuming the root font size is 16 pixels.
The conversion from rem to px depends on the browser’s root font size setting, which is commonly 16px by default. Multiplying the rem value by the root font size gives the pixel equivalent. For 2 rem, multiplying it by 16px results in 32px.
Conversion Tool
Result in px:
Conversion Formula
The formula to convert rem to pixels is:
pixels = rem × root font size (in px)
The root font size is the base font size set by the browser, which is commonly 16px unless changed by the user or CSS. The rem unit stands for “root em” and scales relative to this base size. Multiplying the rem value by 16 gives the pixel equivalent.
Example: Convert 2 rem to pixels
- Start with rem value: 2 rem
- Multiply by root font size: 2 × 16 = 32
- Result is 32 pixels
Conversion Example
- Convert 1.5 rem to pixels:
- Multiply 1.5 by 16 (root font size)
- 1.5 × 16 = 24 pixels
- So, 1.5 rem equals 24 px
- Convert 0.75 rem to pixels:
- 0.75 × 16 = 12 pixels
- Therefore, 0.75 rem is 12 px
- Convert 3 rem to pixels:
- 3 × 16 = 48 pixels
- Thus, 3 rem equals 48 px
- Convert 0 rem to pixels:
- 0 × 16 = 0 pixels
- Zero rem means zero px
Conversion Chart
This chart shows rem values from -23.0 up to 27.0 and their equivalent pixel values, assuming 16px as root font size. Negative rem values represent negative lengths, which can be used in CSS for offsets or positioning.
| rem | px |
|---|---|
| -23.0 | -368.0 |
| -20.0 | -320.0 |
| -15.0 | -240.0 |
| -10.0 | -160.0 |
| -5.0 | -80.0 |
| 0.0 | 0.0 |
| 1.0 | 16.0 |
| 3.0 | 48.0 |
| 5.0 | 80.0 |
| 10.0 | 160.0 |
| 15.0 | 240.0 |
| 20.0 | 320.0 |
| 23.0 | 368.0 |
| 25.0 | 400.0 |
| 27.0 | 432.0 |
Related Conversion Questions
- How many pixels equal 2 rem on different browsers?
- What changes in px if root font size is not 16px but 18px for 2 rem?
- Why does 2 rem sometimes not equal 32 px in CSS?
- Can 2 rem be converted to px when zoom level is changed?
- How to calculate px from rem for 2 rem with custom root font size?
- Is 2 rem always double of 1 rem in pixels?
- What is the exact pixel value of 2 rem on mobile devices?
Conversion Definitions
rem: Rem is a CSS length unit that scales relative to the root element’s font size. It stands for “root em” and allows consistent sizing across a webpage. Unlike em, which is relative to the parent element, rem always uses the root font size, making layout predictable.
px: Px means pixels, the smallest unit of measurement on screens. It represents a single dot on the display, used to measure length, font sizes, spacing, and more. Pixels are absolute units, meaning they remain the same size regardless of other elements or font sizes.
Conversion FAQs
Does the root font size always have to be 16px for rem to px conversion?
No, the root font size can be changed by CSS or browser settings. If a user or developer sets a different root font size, the conversion will vary accordingly. For example, if root is set to 20px, 2 rem equals 40 px instead of 32.
Can rem units be negative and still convert to pixels?
Yes, rem values can be negative, and when converted, they produce negative pixel values. This is sometimes useful in CSS for positioning or creating offsets that move elements in opposite directions.
Does screen resolution affect the rem to px conversion?
No, screen resolution does not affect the rem to px conversion because pixels here refer to CSS pixels, which are logical pixels, not physical screen pixels. The conversion depends solely on the root font size set in the browser or CSS.
Why might 2 rem not equal 32 px on some websites?
This happens if the root font size is changed from the default 16px by CSS rules or browser settings. Also, browser zoom or accessibility settings can alter the effective root font size, making 2 rem calculate differently.
Is rem better than px for responsive design?
Rem units offer scalability and better accessibility because they adapt if the root font size changes, allowing easier resizing for different devices or user preferences. Pixels are fixed, which can make layouts less flexible.