PX to REM Converter
Convert CSS lengths between px, rem, em, pt and other units. rem and em depend on a base font size, so you enter the base to convert with.
How CSS units convert
The CSS absolute units (px, pt, pc, in, cm, mm, Q) are defined in the W3C specification CSS Values and Units, as follows.
| Unit | Definition | In px |
|---|---|---|
| in (inch) | 1in = 2.54cm = 96px | 96 px |
| px (pixel) | 1px = 1/96 in | 1 px |
| pt (point) | 1pt = 1/72 in | 4/3 px (about 1.3333 px) |
| pc (pica) | 1pc = 1/6 in (12pt) | 16 px |
| cm (centimeter) | 1in = 2.54cm | about 37.7953 px |
| mm (millimeter) | 1cm = 10mm | about 3.77953 px |
| Q (quarter-millimeter) | 1Q = 1/40 cm | about 0.944882 px |
The calculation uses exact fractions. A value that does not divide evenly (such as cm, mm or Q in px) is labeled "rounded value".
rem and em depend on a base font size
- rem is relative to the font-size of the root element (
html). With a base of 16px, 1rem = 16px. If you sethtml { font-size: 62.5% }, the base becomes 10px (when the browser default is 16px), and 1.6rem = 16px. - em is relative to the font-size of the element it is used on. The exception is the
font-sizeproperty itself: when em is used infont-size, it refers to the font-size inherited from the parent element (this is what the W3C specification says). In properties such aspaddingandmargin, em refers to the element's own font-size. - Nested em values (for example, 1.2em inside another 1.2em, which multiplies to 1.44) are not calculated here. Enter the computed (actual) font-size as the base.
The 16px starting value is only a convenient default. This tool converts with whichever base (in px) you enter, and a different base gives a different rem or em result.
A CSS pixel is not a screen pixel
A CSS px is not a physical pixel on a screen (a device pixel). It is a reference pixel defined as 1/96 of an inch. On a high-density screen, one CSS pixel can be drawn with several device pixels (for example, 2 × 2).
Examples
- 16px = 1rem = 1em = 12pt (with a base of 16px)
- 24px = 2.4rem (with a base of 10px)
- 1.6rem = 16px (with a base of 10px)
- 1in = 96px = 72pt = 6pc = 2.54cm
- 10mm ≈ 37.79528px
- 0.75pt = 1px
Notes
- Units that depend on the screen size, the parent's size or the shape of the font (vw, vh, %, ch, ex and so on) cannot be converted from a number alone, so they are not included.
- The value can have up to 12 digits before the decimal point and 6 decimal places, and can be negative (CSS has negative lengths, such as
margin: -10px). A base must be greater than 0. Thousands separators such as 1,234.5 are accepted; use a period as the decimal separator. - Results are shown with 7 significant digits. You can copy the value as displayed or with 15 significant digits.
Sources
- W3C, CSS Values and Units Module Level 3: the definitions of the absolute length units, and of em and rem (checked on October 31, 2026; the page was the Candidate Recommendation Draft dated March 22, 2024). It lists rem as the font size of the root element, and em as the computed font-size of the element, or of the parent when used in the
font-sizeproperty.
Frequently asked questions
How many px is 1rem?
It depends on the font-size of the root element (html). With a base of 16px it is 16px, but if the html font-size changes, so does the size of 1rem. Enter your base to convert.
Should I use px or pt?
px and rem are common for screens. pt is more often used in CSS for print. Because 1pt = 4/3 px, 12pt is 16px.
What is the difference between em and rem?
rem is relative to the root element's font-size, so it is the same size wherever you use it. em is relative to the font-size where it is used, so nested elements can change its size.