Skip to content
Free design tool

PX to REM converter

Convert pixel sizes from a design file into rem or em units for responsive CSS, or turn rem values back into pixels. Front end developers use it to keep spacing and type scales consistent.

  • Runs in your browser
  • Free, no account needed
  • Copy or download the result

Your input

17 characters

Plain numbers are
Pixels. Browsers use 16 by default
Relative unit
0 to 10

Result

24px1.5rem
Root font size
16px, so 1rem = 16px
ValueConverted
24px1.5rem
16px 32px1rem 2rem
140.875rem
1.5rem
1rem 2rem
0.875rem

The short answer

Divide the pixel value by the root font size to get rem. Browsers default to 16 px, so 24px is 1.5rem. Multiply rem by the root font size to get pixels again.

Formularem = px / root font size; px = rem x root font size

Worked exampleWith a 16px root font size, 24px is 1.5rem, 32px is 2rem, 16px is 1rem and 14 is 0.875rem.

Example

Input
24px
16px 32px
14
Result
24px1.5rem
Root font size
16px, so 1rem = 16px
ValueConverted
24px1.5rem
16px 32px1rem 2rem
140.875rem
1.5rem
1rem 2rem
0.875rem

How to use the px to rem converter

  1. Type values in the box, one line each, such as 24px, 1.5rem or 16px 24px.
  2. Choose what Plain numbers are, then set Root font size, Relative unit and Decimal places.
  3. The first conversion appears at the top, with a table and CSS-ready values for longer lists. Results update as you type, and Run also works.
  4. Press Copy result or Download to paste the values into your stylesheet.

How it works

rem = px / root font size, and px = rem x root font size. The default root size is 16px, which browsers use unless a user or stylesheet changes it.

Values ending in px are converted to your relative unit, and values ending in rem or em are converted to pixels. Plain numbers follow the Plain numbers are setting, which is Pixels or rem or em.

Each line can hold up to 8 values, so shorthand such as 16px 24px stays on one line. Up to 500 lines are allowed.

em is treated as relative to the same base size you enter. In real CSS, em depends on the parent element's font size, so set the base to that size.

Everything runs in your browser. Your input is not uploaded or stored. If you use Copy link, what you entered is placed in the link.

Questions and answers

How many pixels is 1rem?

1rem equals the root font size, which is 16px in most browsers by default. So 1.5rem is 24px.

How do I convert px to rem?

Divide the pixel value by the root font size. 24px / 16 = 1.5rem.

What is the difference between rem and em?

rem is relative to the root html font size, while em is relative to the font size of the parent element. rem is easier to predict in nested layouts.

Last updated November 1, 2026. Maintained by SnowRock. How our tools work

All 220 SnowRock tools