A PX to REM converter changes pixel values into rem units and back. The formula is rem = pixels ÷ root font size, and browsers use a root size of 16 px by default, so 24 px is 1.5 rem. Enter a value, adjust the base if needed and copy the result.
How to use the PX to REM Converter
- Choose the directionSelect pixels to rem, or rem to pixels.
- Enter the valueType the number to convert. Decimals and negative values are allowed.
- Check the base sizeLeave the root font size at 16 unless your CSS sets a different font-size on the html element.
- Copy the resultCopy the converted value or the ready-made CSS line, or look up common sizes in the table.
How to convert px to rem
A rem ("root em") is a CSS unit equal to the font size of the root element, <html>. Every browser sets that to 16 pixels unless the user or the page changes it. The PX to REM converter uses two simple formulas:
- rem = px ÷ root font size. 24 px ÷ 16 = 1.5 rem.
- px = rem × root font size. 0.875 rem × 16 = 14 px.
With the default base, the values you will use most are: 12 px = 0.75 rem, 14 px = 0.875 rem, 16 px = 1 rem, 18 px = 1.125 rem, 20 px = 1.25 rem, 24 px = 1.5 rem, 32 px = 2 rem and 48 px = 3 rem. The table under the result lists more, recalculated for whatever base you enter.
Some projects set html { font-size: 62.5%; } so that 1 rem equals 10 px and the arithmetic is easier. If yours does, enter 10 as the root font size.
Why use rem instead of px?
Pixels are fixed. Rem values scale with the reader's preferred font size. Many people raise the default text size in their browser or operating system because small text is hard for them to read. A layout written in rem respects that choice: text, spacing and breakpoints grow together. A layout written in px ignores it. For that reason rem is the usual recommendation for font sizes, and it works well for padding, margins and media queries too.
- rem versus em: em is relative to the font size of the current element, so nested elements compound (1.2em inside 1.2em is 1.44 times the base). Rem always refers to the root, which makes sizes predictable.
- When px is fine: hairline borders, small shadows and other details that should not grow with text.
- Do not set the root size in px.
html { font-size: 16px; }overrides the user's setting. Use a percentage if you need to change it.
The conversion to points assumes the CSS definition of 1 px = 0.75 pt (96 px per inch). For physical measurements use the length converter, and to lay out a page in these units try the CSS grid generator.
Frequently asked questions
How many pixels is 1 rem?
16 pixels in every browser by default. It changes only if the page sets a different font size on the html element or the user changes their default text size.
How do I convert px to rem?
Divide the pixel value by the root font size, normally 16. For example 20 px ÷ 16 = 1.25 rem. The PX to REM converter does it for any base.
What is the difference between rem and em?
Rem is relative to the root font size and is the same everywhere on the page. Em is relative to the font size of the element it is used on, so it changes with nesting.
Should I use rem for everything?
Rem suits font sizes, spacing and breakpoints because it follows user settings. Pixels are still reasonable for thin borders and fine details.
What does font-size 62.5% do?
It sets the root size to 62.5% of 16 px, which is 10 px. Then 1 rem = 10 px and 1.6 rem = 16 px, which makes mental conversion easier.
Last updated 24 November 2026 by the TheTechFolk team.