Skip to content
PictureToLink logoPictureToLink
Menu

Px to rem converter

To convert px to rem, divide the pixel value by the root font size. At the browser default of 16px, 24px is 1.5rem, 14px is 0.875rem and 10px is 0.625rem. Enter your own value and root size in this px to rem converter to go either way, from px to rem or from rem to px.

Change any value and the result updates as you type.

px
px

The font-size of the <html> element. Browsers default to 16px.

rem

1.5rem

24 ÷ 16 = 1.5

CSS
font-size: 1.5rem;
Percent of the root size
150%1rem is always 100% of the root font size
Rendered if the user sets a 20px default
30pxrem values grow with the browser font setting; px values do not
Rendered if the user sets a 24px default
36px
px to rem at a 16px root font size
pxremPercent of root
8px0.5rem50%
10px0.625rem62.5%
12px0.75rem75%
13px0.8125rem81.25%
14px0.875rem87.5%
15px0.9375rem93.75%
16px1rem100%
18px1.125rem112.5%
20px1.25rem125%
22px1.375rem137.5%
24px1.5rem150%
28px1.75rem175%
32px2rem200%
36px2.25rem225%
40px2.5rem250%
48px3rem300%
56px3.5rem350%
64px4rem400%
72px4.5rem450%
96px6rem600%

Calculated in your browser; nothing you type is sent or stored. Spotted a wrong result? Tell us.

By Mudasir Ahsan (Founder) · Updated 10 November 2026

On this page

How to use the px to rem converter

  1. Pick the direction: px to rem or rem to px.
  2. Type the value you have. For px to rem it is the pixel size from your design file. For rem to px it is the rem value from a stylesheet.
  3. Leave the root font size at 16px unless your CSS sets html { font-size } to something else.

Results update as you type, with the working shown underneath and a conversion table for the most common sizes at your root.

Two more rows show the value as a percentage of the root, and what it would render at if a visitor raised their browser's default font size to 20px or 24px. That second row is the reason rem exists. A 24px heading stays 24px for everyone, while a 1.5rem heading grows to 30px or 36px for people who need bigger text.

The px to rem formula

A rem is the font-size of the root element, normally the html tag, so 1rem always equals whatever that element is set to. MDN notes that a common browser default is 16px, but user-defined preferences may modify this. Both formulas are one step:

  • rem = px ÷ root font size
  • px = rem × root font size

With the 16px default, 24 ÷ 16 = 1.5rem, and going back, 1.5 × 16 = 24px.

Sizes people look up most are easy to remember, because 16 divides evenly into eighths: 10 px to rem is 0.625rem, 14 px to rem is 0.875rem, 16px to rem is exactly 1rem, 18 px to rem is 1.125rem, 24 px to rem is 1.5rem, 4px to rem is 0.25rem and 1px to rem is 0.0625rem.

Check your root before you convert. Some projects use the 62.5% font size trick (html { font-size: 62.5% }), which makes the root 10px so that 1rem = 10px. Type 10 into the root box and 16px becomes 1.6rem, and every other result follows. It makes mental arithmetic easier, but my advice is to leave the root alone and let a converter do the dividing, as most modern style guides now do. If you inherit a project that already uses it, keep it; switching halfway breaks every rem value at once. The FAQ below explains what it can break.

Px to rem table at the 16px default

pxremPercent of rootTypical use
1px0.0625rem6.25%Hairline borders
2px0.125rem12.5%Focus rings, thick borders
4px0.25rem25%Smallest spacing step
8px0.5rem50%Base spacing unit
10px0.625rem62.5%Tiny labels (too small for body text)
12px0.75rem75%Captions, legal text
13px0.8125rem81.25%Dense UI text
14px0.875rem87.5%Secondary text, table cells
15px0.9375rem93.75%
16px1rem100%Body text
18px1.125rem112.5%Lead paragraphs, large body
20px1.25rem125%h4 / h5
24px1.5rem150%h3, large text in WCAG terms
28px1.75rem175%
32px2rem200%h2
36px2.25rem225%
40px2.5rem250%h1 on small screens
48px3rem300%h1
64px4rem400%Display headings
96px6rem600%Hero numbers

Every value in the table is exact, because each px value is a whole number of sixteenths. Sizes that aren't, such as 15px at an 18px root (0.8333rem), are shown to four decimals. That is more than enough, since browsers round the final computed size to a fraction of a device pixel anyway.

Rem to px in CSS: reading a stylesheet

Rem to px is the question you ask when you read someone else's CSS. How big is padding: 0.75rem 1.25rem? Multiply by the root size. At 16px that is 12px top and bottom and 20px left and right. In the same way max-width: 65rem is 1040px and gap: 2.5rem is 40px. Switch the converter to rem to px and type the number, or read the table above from right to left. To confirm a value on a live page, the "Computed" tab in the browser's developer tools shows the final pixel size of any element.

One catch. In a media query, rem and em ignore your html { font-size } rule and use the browser's initial font size (normally 16px). So @media (min-width: 48rem) is 768px even on a site that uses the 62.5% trick. This is by design: breakpoints track the user's font preference and not the stylesheet.

Px to rem converter for font sizes and spacing

Designers hand over pixel values, and CSS works best in rem for anything that should scale with the reader's text setting. This is the split I'd use:

WhatUnitWhy
Font sizesrem, alwaysA 14px label as 0.875rem shows at 17.5px for a visitor with a 20px default, instead of staying stuck at 14px
Spacing, max-widths, gapsusually remLayouts loosen up along with the text; 8px is 0.5rem, 16px 1rem, 24px 1.5rem
Borders, shadows, hairlinespxA 1px border should stay one pixel; 0.0625rem can round to 0 or 2 pixels after zoom
Media query breakpointseitherBoth work, with the initial-font-size catch above

Most spacing scales are multiples of 4px, so the rem values come out as clean quarters. If a design uses odd values like 13px or 15px everywhere, round them to the scale before converting. Nobody can see a 1px difference in padding, but everyone maintaining the CSS will notice 0.8125rem.

If your font sizes are in rem and the text still looks too small or too large at the user's setting, the units are rarely the problem. It's usually the scale between sizes. Our font size calculator builds a ratio-based scale and outputs every step in rem.

Rem vs px vs em

Rem has one fixed reference, the root, so 1.5rem is the same size everywhere on the page.

Em is relative to the font size of the element's parent. 1.5em inside a 20px card is 30px, inside a 14px footnote it is 21px, and nested em values multiply. Em is the right unit when something should scale with its own container, such as the padding inside a button or an icon next to its label. Rem is right for everything that should scale with the page. The px to em converter handles the parent-relative case, including the compounding.

Px is absolute within the page. It never follows the user's font-size setting, though it does scale with browser zoom (Ctrl + plus), because zoom resizes the CSS pixel itself. The WCAG "resize text" criterion asks that text can be enlarged to 200% without loss, and zoom satisfies that. Respecting the font-size preference is what rem gives you on top.

Need real-world sizes too? The pixels to inches converter covers physical units and screen density.

Questions and answers

How many rem is 16px?

At the browser default root font size of 16px, 16px is exactly 1rem. At a 10px root (the 62.5% trick) it is 1.6rem, and at an 18px root it is 0.8889rem. The converter uses whatever root size you type.

What is 24px in rem?

24px is 1.5rem at a 16px root (24 ÷ 16 = 1.5). It is also the size WCAG counts as "large text" (18 point), where a lower 3:1 contrast ratio is allowed. The color contrast checker shows the thresholds.

Why is 16px the default?

Early browsers used 12 point text as their default, which is 16px at the 96 dpi that CSS assumes, and every browser since has kept it for compatibility. Users can change it in their browser settings. When they do, every rem value on the page scales with it while px values stay fixed.

Does the 62.5% trick break anything?

It makes 1rem = 10px for your own CSS. Embedded widgets, ad units and component libraries that assume 1rem = 16px will render at 62.5% of their intended size, and media queries in rem still use 16px. Many teams have dropped the trick for that reason and use a converter or a preprocessor function.

All image, photo and design calculators