Free tool

REM to PX converter

To convert rem to px, multiply by the root font size: with the browser default of 16px, 1rem = 16px, 1.5rem = 24px and 0.875rem = 14px. Change the root size below if your site uses another one, and see each value as a Tailwind class too.

Free · no sign-up · runs in your browser, nothing is uploaded

rem → px
rem
px

1rem = 16px. The root is the font-size of the html element; browsers default to 16px.

Result

1.5rem = 24px

CSS 24px /* 1.5rem */

Tailwind class

v4: p-6

v3: p-6

font-size: text-2xl

Also

18pt

1.5em

Conversion table at 16px root
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
1.875rem30px
2rem32px
2.25rem36px
2.5rem40px
3rem48px
3.5rem56px
3.75rem60px
4rem64px
4.5rem72px
5rem80px
6rem96px
8rem128px
10rem160px

Convert a whole stylesheet

CSS with rem
CSS with px

Paste CSS, SCSS or a style attribute. Every rem value is converted at 16px; comments, strings and url() stay as they are.

REM to PX conversion table (16px root)

Common rem values at the browser default. The tool above recalculates the same table for any root size.

REMPixelsREMPixels
0.0625rem1px1.875rem30px
0.125rem2px2rem32px
0.25rem4px2.25rem36px
0.375rem6px2.5rem40px
0.5rem8px3rem48px
0.625rem10px3.5rem56px
0.75rem12px3.75rem60px
0.875rem14px4rem64px
1rem16px4.5rem72px
1.125rem18px5rem80px
1.25rem20px6rem96px
1.375rem22px8rem128px
1.5rem24px10rem160px
1.75rem28px

Tailwind spacing scale in px

Tailwind's spacing utilities (p-*, m-*, gap-*, w-*, h-*, inset-*) use steps of 0.25rem, which is 4px at a 16px root. So the class number times 4 gives the pixels. In v4 this comes from one --spacing: 0.25rem variable and any multiple of 0.25 works (p-13, mt-4.5); v3 ships the fixed list below.

Class stepREMPixels (16px root)
p-0.50.125rem2px
p-10.25rem4px
p-1.50.375rem6px
p-20.5rem8px
p-2.50.625rem10px
p-30.75rem12px
p-3.50.875rem14px
p-41rem16px
p-51.25rem20px
p-61.5rem24px
p-71.75rem28px
p-82rem32px
p-92.25rem36px
p-102.5rem40px
p-112.75rem44px
p-123rem48px
p-143.5rem56px
p-164rem64px
p-205rem80px
p-246rem96px
p-287rem112px
p-328rem128px
p-369rem144px
p-4010rem160px
p-4812rem192px
p-5614rem224px
p-6416rem256px
p-7218rem288px
p-8020rem320px
p-9624rem384px
p-px–1px

Tailwind font sizes in px

ClassREMPixels (16px root)
text-xs0.75rem12px
text-sm0.875rem14px
text-base1rem16px
text-lg1.125rem18px
text-xl1.25rem20px
text-2xl1.5rem24px
text-3xl1.875rem30px
text-4xl2.25rem36px
text-5xl3rem48px
text-6xl3.75rem60px
text-7xl4.5rem72px
text-8xl6rem96px
text-9xl8rem128px

Each text class also sets a matching line-height. If you change the root font size, every value in both tables scales with it.

Formula and code

px = rem × root font size

1.5rem   × 16 = 24px
0.875rem × 16 = 14px
2.4rem   × 10 = 24px   (html { font-size: 62.5%; })

JavaScript, with the root size the page really uses:

const root = parseFloat(getComputedStyle(document.documentElement).fontSize);
const remToPx = rem => rem * root;
remToPx(1.5); // 24 at a 16px root

Inside CSS you rarely need the px number: calc(1.5rem + 2px) mixes the two units and the browser resolves it. To check what an element ends up with, the Computed tab in DevTools lists every length in px.

Why the same rem gives different pixels

  • The site sets the root. html { font-size: 62.5% } gives a 10px root, so a design file's 24px is 2.4rem in the CSS. Paste such a value with root 10 to get the pixels back.
  • The reader sets the default. Browsers let people pick a larger default text size. With 20px as the default, 1rem is 20px on sites that do not override it, which is the point of using rem.
  • Media queries use the default, not the root. @media (min-width: 40rem) is 640px with a 16px default, even when html sets 10px.
  • em is not rem. 1.5em inside a 20px element is 30px. Only rem always points at the root.

Going the other way? The PX to REM converter divides instead, and its bulk mode turns a whole px stylesheet into rem. For colors, use the color converter, and see Tailwind CSS tools on DevHunt.

FAQ

How many px is 1rem?+

1rem is the font-size of the root html element. Browsers default that to 16px, so 1rem = 16px unless your CSS sets another root size (62.5% makes it 10px) or the reader changed the default text size in their browser.

Is 1rem always 16px?+

No. 16px is only the browser default. html { font-size: 62.5% } makes 1rem = 10px, html { font-size: 18px } makes it 18px, and a user who sets their browser text size to "Large" gets a bigger rem on every site that uses it.

How do I convert rem to px?+

Multiply the rem value by the root font size. At 16px: 1.5rem × 16 = 24px, 0.875rem × 16 = 14px, 2.5rem × 16 = 40px.

How many px is 0.5rem?+

8px at the default 16px root (0.5 × 16). In Tailwind that is spacing step 2, as in p-2 or gap-2.

How many rem is 40px?+

2.5rem at a 16px root (40 ÷ 16), and 4rem at a 10px root. In Tailwind, 2.5rem is spacing step 10 (p-10).

How do I get the real pixel value of a rem in the browser?+

Read the root size with getComputedStyle(document.documentElement).fontSize and multiply. Or select the element in DevTools and look at the Computed tab, which shows every length already resolved to px.

Why does my 48rem media query not match 480px with a 10px root?+

rem and em in media query conditions use the browser default font size, not the root you set in CSS. 48rem in a media query is 768px with a 16px default, whatever html { font-size } says.

Sources: CSS Values and Units 4: rem unit · Media Queries 4: units · MDN: font-size · MDN: getComputedStyle() · Tailwind CSS: padding and the spacing scale · Tailwind CSS: font-size · Tailwind CSS v4: spacing multiplier instead of a fixed scale (PR #14857). Checked 2026-10-30.