PX to REM Converter

Need to convert pixels to REM for your website or CSS? Our free PX to REM Converter makes it quick and easy to convert PX values into REM units and convert REM back to pixels. Enter a value, choose the conversion direction, and set the root font size if needed. It is useful for responsive web design, CSS, typography, spacing, and creating scalable website layouts.

Result: Enter a value to convert.

What Is a PX to REM Converter?

A PX to REM Converter helps you convert pixel values into REM units for CSS and web design. It can also convert REM values back into pixels.

REM is commonly used in modern web development because it allows sizes to scale relative to the root font size of a webpage.

How to Use the PX to REM Converter

Using the converter is simple:

  1. Choose PX → REM or REM → PX.
  2. Enter the value you want to convert.
  3. Enter the root font size in pixels.
  4. Click Convert.
  5. The converted value will appear in the result box.

The root font size is set to 16 PX by default, but you can change it if your website uses a different value.

How Do You Convert PX to REM?

The basic formula is:

REM = PX ÷ Root Font Size

For example, if the root font size is 16 PX:

32 PX ÷ 16 = 2 REM

So, 32 PX is equal to 2 REM when the root font size is 16 PX.

How Do You Convert REM to PX?

To convert REM back to pixels, use:

PX = REM × Root Font Size

For example:

2 REM × 16 = 32 PX

So, 2 REM is equal to 32 PX when the root font size is 16 PX.

Why Is 16 PX Commonly Used?

Many websites use a root font size of 16 PX as a starting point. With a 16 PX root size:

  • 1 REM = 16 PX
  • 0.5 REM = 8 PX
  • 1.5 REM = 24 PX
  • 2 REM = 32 PX
  • 3 REM = 48 PX

However, the actual root font size can be different depending on how a website is designed.

PX vs. REM

PX and REM are both CSS units, but they behave differently.

PX (pixels) represents a fixed CSS length.

REM (root em) is relative to the font size of the root HTML element.

For example, if the root font size is 16 PX, 2 REM equals 32 PX. If the root font size changes, the pixel equivalent of 2 REM changes as well.

Why Use REM in CSS?

REM can be useful when creating flexible and scalable websites. Because REM values are based on the root font size, they can make it easier to maintain consistent sizing across a website.

REM is commonly used for:

  • Font sizes
  • Margins
  • Padding
  • Spacing
  • Website layouts
  • Responsive design

Common PX to REM Conversions

Using a 16 PX root font size:

PXREM
8 PX0.5 REM
12 PX0.75 REM
16 PX1 REM
20 PX1.25 REM
24 PX1.5 REM
32 PX2 REM
40 PX2.5 REM
48 PX3 REM
64 PX4 REM

These values assume a root font size of 16 PX.

When Can You Use a PX to REM Converter?

This converter can be useful when:

  • Converting existing CSS values
  • Creating responsive websites
  • Choosing scalable font sizes
  • Converting margins and padding
  • Working with CSS spacing
  • Updating an older website
  • Building WordPress websites
  • Designing responsive layouts

Frequently Asked Questions

What is 16 PX in REM?

With a 16 PX root font size, 16 PX = 1 REM.

What is 32 PX in REM?

With a 16 PX root font size, 32 PX = 2 REM.

What is 1 REM in PX?

With a 16 PX root font size, 1 REM = 16 PX.

Can I change the root font size?

Yes. The converter lets you enter your own root font size instead of always using 16 PX.

Is REM better than PX?

PX and REM serve different purposes. REM can be useful when you want sizing to remain relative to the root font size, while PX can be useful when you need a specific fixed CSS value.

Does the converter work both ways?

Yes. You can convert PX to REM or REM to PX using the same calculator.

Related Technology Tools

You may also find these NexCalco tools useful:

Scroll to Top