Maaz Zindani

Loading the index…

↑↓ move↵ openesc close3993 pages

Free tool · Developer tools

Px to rem converter

Type a size, choose the units, and get the answer at once for any base font size. The table below lists the sizes people look up most.

  • Free
  • No sign-up
  • Runs in your browser

By Maaz Zindani · Updated

1rem equals this. Browsers start at 16px; users and your CSS can change it.
Result
1.5rem
  • 24px = 1.5rem at a 16px base
px
24
rem
1.5
em
1.5
pt
18
Percent
150

Common px to rem values

pxrempt
8px0.5rem6pt
10px0.625rem7.5pt
12px0.75rem9pt
14px0.875rem10.5pt
16px1rem12pt
18px1.125rem13.5pt
20px1.25rem15pt
24px1.5rem18pt
28px1.75rem21pt
32px2rem24pt
36px2.25rem27pt
40px2.5rem30pt
48px3rem36pt
64px4rem48pt

Table for a 16px base. Change the base above for your own.

How to use the Px to Rem Converter

  1. Type a number into Value.
  2. Choose the unit you have under From and the unit you want under To.
  3. Set Base font size (px) if your root font size is not 16px.
  4. Read the large answer under Result. The boxes under it show the same size in every unit. Copy puts the answer, with its unit, on the clipboard.

How do I convert px to rem?

Divide the pixel value by the root font size. At the usual 16px root, 24px / 16 = 1.5rem, 12px / 16 = 0.75rem and 16px / 16 = 1rem. To go the other way, multiply: 2.5rem x 16 = 40px. The converter does this as you type and rounds to four decimals, so 0.5px at a 16px base shows as 0.0313rem.

The 16px figure is not a rule of CSS. It is the font size most browsers start with, and a visitor can change it in their browser settings. A site can also set the root size itself, for example html { font-size: 62.5% } to make 1rem equal 10px. If your project does that, enter 10 in Base font size (px) and the answers follow.

What is the difference between rem and em?

A rem is relative to the font size of the root element (the html element), so it is the same everywhere on the page. An em is relative to the font size of the element it is used on (or, for the font-size property itself, its parent), so nested elements can compound: a 1.2em list inside a 1.2em list is 1.44 times the original.

This tool treats em as relative to the same base you enter, which is right when the parent has that font size. If your element sits inside a parent with another size, enter that parent size as the base to get the correct em value. The same goes for the percent option: 150% of a 16px base is 24px.

Points are fixed: CSS defines 1pt as 1/72 of an inch and 1px as 1/96 of an inch, so 12pt is 16px and one pixel is 0.75pt, whatever the base font size. That is why the pt result does not change when you change the base.

Why use rem for sizes, and when not to?

Sizes in rem grow when a visitor raises their default text size, which pixel sizes do not do in the same way. That makes rem a good choice for font sizes, line heights and spacing that should scale with the reader's settings. It also makes global changes simple: change the root size once and the layout scales with it.

Pixels are still fine for things that should stay fixed, such as a 1px border or a hairline. If a converted value looks wrong in your page, check which element sets the font size it is measured against.

Round numbers help readability. 0.875rem, 1rem, 1.125rem, 1.25rem and 1.5rem are 14px, 16px, 18px, 20px and 24px at the default base, and the table above shows more. Odd results such as 0.8125rem (13px) are fine; the browser does the maths.

Use it with

Questions

How many px is 1rem?

It equals the root font size. In most browsers that starts at 16px, so 1rem is 16px, unless your CSS or the visitor's browser settings change it.

How do I convert 14px to rem?

Divide by the base: 14 / 16 = 0.875rem at a 16px base.

Is 16px always the base size?

No. It is the common browser default, but visitors can change it and your own CSS can set another root size. Enter your size in Base font size.

What is the difference between rem and em?

rem is relative to the root element's font size; em is relative to the current element's (or its parent's) font size, so nested ems compound.

How many pt is 16px?

12pt. One pixel is 0.75 point, and the ratio does not depend on the base font size.

How this page was made: the tool's results are computed in your browser by the code on this page, using the sources listed above; the explanations were drafted with AI help and checked against the tool's own output.