REM to PX Converter

Convert REM units to Pixels.

Loading converter...
Share this tool:

REM to PX Converter

A REM to PX converter is a tool that translates relative CSS units (root em) into fixed pixel values. It works by multiplying the REM value by the root font size, typically 16 pixels by default in web browsers. This conversion helps web developers and designers bridge the gap between scalable, responsive typography and precise, pixel-based design specifications.

What are REM and PX Units?

REM and PX are the two most common CSS units for sizing text, spacing, and layout elements. REM scales with the root font size. PX stays fixed no matter what the user's browser settings are.

What is REM?

REM stands for "root em." It is a relative CSS unit that calculates sizes based on the font size of the root element, which is the <html> element in an HTML document.

When you set a font size of 16 pixels on the root element, 1 REM equals 16 pixels. If you set the root font size to 20 pixels, then 1 REM equals 20 pixels. This relationship makes REM units scalable and responsive to user preferences.

What is PX?

PX stands for "pixels." It is an absolute CSS unit that represents a fixed measurement on the screen. One pixel equals one dot on a display.

Pixels do not change based on the root font size, user settings, or screen size. When you set font-size: 16px, the text always appears at 16 pixels tall regardless of the browser's default font size or the user's accessibility settings.

Difference Between REM and PX

  • REM is relative to the root font size; PX is fixed
  • REM scales with user preferences; PX does not
  • REM supports responsive design; PX requires media queries for responsiveness
  • REM improves accessibility; PX can cause readability issues on different screen densities
  • REM is more complex to calculate; PX is straightforward

What is 1 rem in pixels?

1 REM equals 16 pixels when using the default browser font size of 16px.

This relationship comes from the standard browser default. Most modern browsers set the root font size to 16 pixels. Therefore, 1 REM = 16 PX by default.

If you change the root font size in your CSS, the conversion changes accordingly. For example:

  • With root font size 10px: 1 REM = 10 PX
  • With root font size 20px: 1 REM = 20 PX
  • With root font size 62.5% (10px equivalent): 1 REM = 10 PX

How to Use the REM to PX Converter

To use the REM to PX converter:

  1. Step 1: Enter the REM value you want to convert in the input field labeled "REM."
  2. Step 2: Set the base font size (default is 16px). Use the value defined on your HTML element in your CSS.
  3. Step 3: Click the convert button or press Enter. The tool will display the equivalent pixel value.
  4. Step 4: Copy the result and apply it to your CSS.

REM to PX Conversion Formula

The formula for converting REM to PX is:

px=rem×base font size
Where:
pxPixels — the resulting pixel value
remREM Units — the value in root em units
base font sizeBase/Root Font Size — the font size set on the HTML element (default 16px)

Example (base font size 16px, convert 2rem):

px=2×16=32px

REM to PX Conversion Examples

Using a base font size of 16px:

0.5rem×16=8px
0.75rem×16=12px
1rem×16=16px
1.25rem×16=20px
1.5rem×16=24px
2rem×16=32px
3rem×16=48px
4rem×16=64px

REM to PX Conversion Table

REM to PX (Base 16px)

REMPX
0.0625rem1px
0.125rem2px
0.25rem4px
0.375rem6px
0.5rem8px
0.625rem10px
0.75rem12px
0.875rem14px
1rem16px
1.125rem18px
1.25rem20px
1.375rem22px
1.5rem24px
1.75rem28px
2rem32px
2.5rem40px
3rem48px
4rem64px
5rem80px
6rem96px
8rem128px
10rem160px

PX to REM (Base 16px)

PXREM
1px0.06rem
2px0.13rem
4px0.25rem
8px0.5rem
12px0.75rem
14px0.875rem
16px1rem
20px1.25rem
24px1.5rem
32px2rem
40px2.5rem
48px3rem
64px4rem
80px5rem
96px6rem
128px8rem
160px10rem

FAQs

What base font size should I use for conversion?

Most browsers set the default base font size at 16px. Use the value defined on the html element in a project’s CSS file if that value differs from the browser default.

Will converting REM to PX affect responsiveness?

Yes, converting REM to PX affects responsiveness. PX values stay fixed and do not scale with a user’s browser font-size settings, so replacing REM with PX across a layout reduces its ability to adapt to accessibility preferences and different screen sizes.

Is REM supported by all browsers?

Yes, REM is supported by all modern browsers, including Chrome, Firefox, Safari, and Edge, on both desktop and mobile versions.

Can I mix REM and PX in one stylesheet?

Yes, mixing REM and PX in one stylesheet is common practice. Developers typically use REM for font sizes and spacing, then use PX for borders, shadows, and other fixed-size elements.

Why do design tools use pixels instead of REM?

Design tools use pixels because pixel values give exact, unchanging measurements across a design file. This precision matches how design software renders layouts, while REM values depend on a root font-size setting that design tools do not calculate automatically.

How to convert PX to REM?

Divide the pixel value by the base font size, usually 16px, to convert PX to REM. For example, 16px ÷ 16 = 1rem, and 24px ÷ 16 = 1.5rem.

When to use PX, EM, or REM?

Use PX for fixed sizes that should never change, such as borders and shadows. Use EM for sizes relative to a parent element’s font size. Use REM for responsive typography and layout spacing relative to the root font size.

Why use REM instead of PX?

REM improves accessibility and responsive design because REM values scale with a user’s preferred browser font size. This makes a website more adaptable across different screen sizes and user settings.

How to calculate PX to REM?

The formula is REM = PX ÷ Base Font Size. With a standard 16px base font size, 16px equals 1rem, 8px equals 0.5rem, and 32px equals 2rem.

When should I use PX units instead of REM?

Use PX units for precise measurements that should not scale, such as borders, shadows, and small decorative elements. PX also works well for maintaining exact pixel-perfect designs.

Why should I use REM for font sizes?

REM keeps font sizes consistent across a website while respecting a user’s browser font-size settings. This improves accessibility and supports responsive typography across devices.

What are some common REM to PX conversions?

Common REM to PX conversions include 0.5rem = 8px, 0.75rem = 12px, 1rem = 16px, 1.25rem = 20px, 1.5rem = 24px, and 2rem = 32px. These values apply to the standard 16px root font-size used by most browsers.