PX to REM converter

Convert pixels to rem units with your own root font size, with a reference table of common sizes and the formula explained. Free, no sign-up.

24 px1.5 rem
MAKE IT YOURS
font-size: 1.5rem;

How do you convert PX to REM?

Divide the pixel value by the root font size. For example, 24px divided by a 16px root is 1.5rem. If your site sets a different root size, enter that value instead. REM follows the root element’s font size; it does not refer to the parent element.

Why bother? A reader can change the default font size in their browser settings. Sizes in rem follow that choice. Sizes in px stay fixed when that setting changes, although page zoom still scales them. Using rem for font sizes is a simple way to respect the reader’s preference. More in rem vs em vs px.

Some older stylesheets set html { font-size: 62.5% } so that 1rem equals 10px and the arithmetic is easy. It works, but every component that assumes a 16px root then needs adjusting, including third-party ones. Leaving the root alone and converting with a tool is the safer habit. Going the other way? Use the REM to PX converter.

PixelsREM at a 16px rootPixelsREM at a 16px root
8px0.5rem24px1.5rem
10px0.625rem28px1.75rem
12px0.75rem32px2rem
13px0.8125rem36px2.25rem
14px0.875rem40px2.5rem
15px0.9375rem48px3rem
16px1rem56px3.5rem
18px1.125rem64px4rem
20px1.25rem72px4.5rem
22px1.375rem96px6rem
Common pixel sizes and their rem values at the browser default root size of 16px.
How many pixels is 1rem?

16px by default in every major browser. It changes if the site sets a font size on the html element or the reader changes their browser’s default font size.

Should I use rem or px for font sizes?

Use rem for font sizes so text follows the reader’s settings. Pixels are fine for things that should not scale, such as a 1px border.

Do rem units work in media queries?

Yes. In a media query, rem and em refer to the browser’s default font size, not to a font size set on the html element.

Read the guide: Build a typography scale that feels like a system

See how real sites set their type.

Font Inspector shows the font, size, line height and spacing of any text on any website, then copies it as CSS. Free, no account.

Add to Chrome