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.
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.
| Pixels | REM at a 16px root | Pixels | REM at a 16px root |
|---|---|---|---|
| 8px | 0.5rem | 24px | 1.5rem |
| 10px | 0.625rem | 28px | 1.75rem |
| 12px | 0.75rem | 32px | 2rem |
| 13px | 0.8125rem | 36px | 2.25rem |
| 14px | 0.875rem | 40px | 2.5rem |
| 15px | 0.9375rem | 48px | 3rem |
| 16px | 1rem | 56px | 3.5rem |
| 18px | 1.125rem | 64px | 4rem |
| 20px | 1.25rem | 72px | 4.5rem |
| 22px | 1.375rem | 96px | 6rem |
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.
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.