Skip to content
1440px

px to rem

rem = px ÷ root font size — with a live converter and the full table.

Formula
rem = px ÷ root font size

At the browser default root size of 16px: 16px = 1rem.

Dividing by the root font size is the whole calculation. With the browser default of 16px, 16px is 1rem — which is why so many design systems pick 16 as their base.

Converter

px to rem conversion table

px to rem at each common root font size
Value10px root12px root14px root16px root18px root20px root
1px0.1rem0.0833rem0.0714rem0.0625rem0.0556rem0.05rem
2px0.2rem0.1667rem0.1429rem0.125rem0.1111rem0.1rem
4px0.4rem0.3333rem0.2857rem0.25rem0.2222rem0.2rem
6px0.6rem0.5rem0.4286rem0.375rem0.3333rem0.3rem
8px0.8rem0.6667rem0.5714rem0.5rem0.4444rem0.4rem
10px1rem0.8333rem0.7143rem0.625rem0.5556rem0.5rem
12px1.2rem1rem0.8571rem0.75rem0.6667rem0.6rem
14px1.4rem1.1667rem1rem0.875rem0.7778rem0.7rem
16px1.6rem1.3333rem1.1429rem1rem0.8889rem0.8rem
18px1.8rem1.5rem1.2857rem1.125rem1rem0.9rem
20px2rem1.6667rem1.4286rem1.25rem1.1111rem1rem
22px2.2rem1.8333rem1.5714rem1.375rem1.2222rem1.1rem
24px2.4rem2rem1.7143rem1.5rem1.3333rem1.2rem
28px2.8rem2.3333rem2rem1.75rem1.5556rem1.4rem
32px3.2rem2.6667rem2.2857rem2rem1.7778rem1.6rem
36px3.6rem3rem2.5714rem2.25rem2rem1.8rem
40px4rem3.3333rem2.8571rem2.5rem2.2222rem2rem
44px4.4rem3.6667rem3.1429rem2.75rem2.4444rem2.2rem
48px4.8rem4rem3.4286rem3rem2.6667rem2.4rem
56px5.6rem4.6667rem4rem3.5rem3.1111rem2.8rem
64px6.4rem5.3333rem4.5714rem4rem3.5556rem3.2rem
72px7.2rem6rem5.1429rem4.5rem4rem3.6rem
80px8rem6.6667rem5.7143rem5rem4.4444rem4rem
96px9.6rem8rem6.8571rem6rem5.3333rem4.8rem
112px11.2rem9.3333rem8rem7rem6.2222rem5.6rem
128px12.8rem10.6667rem9.1429rem8rem7.1111rem6.4rem
144px14.4rem12rem10.2857rem9rem8rem7.2rem
160px16rem13.3333rem11.4286rem10rem8.8889rem8rem
192px19.2rem16rem13.7143rem12rem10.6667rem9.6rem
224px22.4rem18.6667rem16rem14rem12.4444rem11.2rem
256px25.6rem21.3333rem18.2857rem16rem14.2222rem12.8rem
320px32rem26.6667rem22.8571rem20rem17.7778rem16rem
384px38.4rem32rem27.4286rem24rem21.3333rem19.2rem
448px44.8rem37.3333rem32rem28rem24.8889rem22.4rem
512px51.2rem42.6667rem36.5714rem32rem28.4444rem25.6rem

Set it up once in CSS

CSS
/* 62.5 % makes 1rem = 10px, so 1.6rem = 16px.
   Convenient, but it overrides the user's browser preference at the root —
   prefer keeping the default and doing the maths. */
html { font-size: 100%; }        /* 16px, respects user preference */

:root {
  --step-0: 1rem;      /* 16px */
  --step-1: 1.25rem;   /* 20px */
  --step-2: 1.5rem;    /* 24px */
  --step-3: 2rem;      /* 32px */
}

/* Fluid type without a converter, using clamp() */
h1 { font-size: clamp(1.75rem, 1.2rem + 2.5vw, 3rem); }

Questions

How do I convert px to rem?

rem = px ÷ root font size. With the browser default root font size of 16px, 16px = 1rem.

What if the root font size is not 16px?

Then every value changes proportionally. The table above shows all six common root sizes side by side. Note that the root font size is whatever html computes to — if a user has increased their browser's default text size, your rem values scale with it, which is exactly why rem is preferred over px for typography.

How do I convert rem back to px?

Invert the formula, or use the rem to px converter.

Should I use rem or px in CSS?

Use rem for anything that should scale with the user's font-size preference — type, spacing, container widths. Use px for things that genuinely should not scale, like hairline borders and some shadows. Ignoring the user's setting by sizing type in px is an accessibility problem, not a style choice.

Other conversions

Common px values

Conversions follow the CSS Values and Units specification, in which 1in is defined as exactly 96px. Values are computed, not tabulated by hand.