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.

px
px
The starting value of 16px is the default font size in most browsers. It is not a value set by the CSS specification, and it changes with the user's settings and the site's CSS. You can change both bases. They do not affect a conversion that does not involve rem or em.
Converted value —

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

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

Notes

Sources

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.