Skip to main content

PX to REM Converter

Convert PX to REM instantly using any root font size. Enter a pixel value, copy the REM result, and check common PX to REM conversions.

Pixels
px
REM
rem

Based on the computed font size of the root <html> element.

REM Size Preview

Lorem Ipsum is simply dummy text of the printing and typesetting industry.

Common PX to REM conversions

Based on a 16px root font size.

PXREM
1px0.0625rem
2px0.125rem
4px0.25rem
8px0.5rem
10px0.625rem
12px0.75rem
14px0.875rem
16px1rem
18px1.125rem
20px1.25rem
24px1.5rem
28px1.75rem
32px2rem
40px2.5rem
48px3rem
64px4rem

Your tool input is processed locally in your browser—not uploaded to or stored by Bitty Coder. Privacy Policy

What is a PX to REM converter?

A PX to REM converter changes a CSS pixel value into a root-relative rem value. The result depends on the font size of the document root, normally the computed font-size of the html element.

Many browsers use 16px as the initial root font size, but projects can set a different value. This converter therefore lets you change the root font size instead of assuming that 1rem always equals 16px.

How to convert PX to REM

  1. Start with the default 16px = 1rem conversion, or enter another pixel value.
  2. Keep the root font size at 16px, or change it to match your project.
  3. Copy the REM result.

Both fields are editable. You can also paste values such as 24px or 1.5rem, select a common root-size preset, and paste the other unit to move the value to the matching field.

PX to REM formula and example

Use this formula:

REM = PX ÷ Root Font Size

For a 16px root font size:

24px ÷ 16px = 1.5rem

Changing the root font size changes the result. With a 20px root, the same 24px value becomes 1.2rem.

Common PX to REM conversions

The interactive table above updates when you change the root font size and can be exported as a CSV file. These common values use a 16px root:

PXREM
4px0.25rem
8px0.5rem
12px0.75rem
16px1rem
20px1.25rem
24px1.5rem
32px2rem
48px3rem

PX vs. REM

PXREM
A CSS absolute length unitRelative to the root element’s font size
Direct for fixed visual detailsScales when the root font size changes
Often useful for borders and other small fixed detailsOften useful for typography and scalable spacing

PX and REM are both valid CSS units. Converting every pixel value is not automatically better; choose the unit that matches how the property should respond when the root font size changes.

When should you convert PX to REM?

PX to REM conversion is useful when implementing a design measured in pixels, moving older CSS toward root-relative sizing, checking typography tokens, or creating spacing values that should scale with the root font size.

Need the reverse calculation? Use the REM to PX Converter.

PX to REM FAQ

How do I convert PX to REM?

Divide the pixel value by the root font size. For example, 24 ÷ 16 = 1.5rem.

How many REM is 16px?

At a 16px root font size, 16px equals 1rem. At a 20px root, 16px equals 0.8rem.

Is 1rem always equal to 16px?

No. 1rem equals the computed font size of the root element. It equals 16px only when that root font size is 16px.

What root font size should I use?

Use the computed font-size of your project’s html element. If the project does not change it, 16px is a practical starting point.

Can I convert negative PX values?

Yes. Negative CSS lengths are useful for properties such as margins and transforms, so this converter preserves the sign.

What is the difference between REM and EM?

REM is based on the root element’s font size. EM depends on the element’s own font size for most properties, and on the parent font size when used for font-size.