PX to REM Converter
Pixels to rem, em and points at any base font size, and back.
About PX to REM Converter
A px to rem converter that turns pixels into rem, em and points and back again, using a base font size you choose, with a table of common sizes.
How to use
- Leave the base font size at 16, the browser default, or change it to match the
font-sizeset on yourhtmlelement. - Type in any of the four fields: pixels, rem, em or points. The other three update as you type.
- Copy a value with its unit from the button above each field, or take one from the common sizes table, which follows the base.
What it does
- Divides pixels by the base to get rem, and multiplies to go back: 24px at a base of 16 is 1.5rem.
- Converts points with the fixed CSS ratio of 96px to 72pt, so 12pt is 16px and 1px is 0.75pt, whatever the base.
- Treats em the same as rem. In a stylesheet em is relative to the font size of the surrounding element, so the em figure is right only where that size equals the base.
- Accepts zero, negative values and decimals, and rounds results to 12 significant figures.
- Does not read your stylesheet, does not follow nested em sizes, and does not convert viewport or percentage units.
Example
Base 16: 24px = 1.5rem = 1.5em = 18pt
Base 10: 24px = 2.4rem = 2.4em = 18pt
Privacy
The numbers are converted in the browser. No request is made, and nothing is stored.
Frequently asked questions
- How do I convert px to rem?
- Divide the pixel value by the root font size. With the browser default of 16px, 24px is 24 ÷ 16 = 1.5rem. To go back, multiply the rem value by the root font size.
- How many pixels is 1rem?
- 1rem equals the font size of the root html element. Browsers default to 16px, so 1rem is 16px unless the site or the reader has changed it. At a root size of 10px, 1rem is 10px.
- What is the difference between rem and em?
- rem is relative to the font size of the root element, so it means the same everywhere on the page. em is relative to the font size of the element it is used in, so nested em values multiply. That is why rem is the usual choice for consistent spacing and type.
- How do I convert pt to px?
- Multiply points by 96 ÷ 72, about 1.333. CSS defines an inch as both 96px and 72pt, so 12pt is 16px and 9pt is 12px. The ratio is fixed and does not depend on the base font size.