UnitPlanet

Pixel Unit Converter

CSS uses four absolute-length units for typography: px (CSS pixels), rem (root ems), em (parent ems), and pt (PostScript points). All four ultimately reference the CSS inch, defined by the W3C as exactly 96 CSS pixels — making 1 pt = 96/72 px ≈ 1.333 px and 1 rem = the root element's font size in px (browser default: 16 px).

The formula

CSS absolute length anchor (W3C CSS Values Level 4):
  1 in = 96 CSS px = 72 pt

Derived:
  1 pt  = 96/72 px = 4/3 px ≈ 1.3333 px
  1 px  = 72/96 pt = 3/4 pt = 0.75 pt

Relative units (depend on base font size):
  1 rem = base_font_size_px        (root element font size)
  1 em  = parent_element_font_size (compounds in nested elements)

At browser default (base = 16 px):
  1 rem = 16 px
  16 px = 1 rem
  12 px = 0.75 rem
  14 px = 0.875 rem
  18 px = 1.125 rem
  24 px = 1.5 rem

Practical examples

Example 1 — Converting a design spec from px to rem. Design file says 24px font size. Browser base is 16px. In CSS: 24 / 16 = 1.5 rem. This value scales with the user's browser font size preference.

Example 2 — Converting print point sizes to CSS px. Microsoft Word uses 12pt body text. In CSS: 12 × (4/3) = 16 px — exactly the browser default body text size. This is not a coincidence: CSS was designed to match print conventions.

Example 3 — Design system with non-standard base. A design system sets html { font-size: 10px; } to make math easier. Then 1 rem = 10 px, 1.4 rem = 14 px, 2.4 rem = 24 px. Update this converter's base to 10 px to work in that system.

Common mistakes

  • Using em instead of rem for font sizes. em inherits from the parent element, so it compounds in nested markup. A paragraph inside a div both set to font-size: 1.2em results in 1.2 × 1.2 = 1.44× the root size. rem avoids this by always referencing the root.
  • Confusing CSS pixels with device pixels. On a 2× retina screen, 1 CSS px maps to 2 physical display pixels. CSS px is a logical unit. Physical pixel density (DPI/PPI) is separate.
  • Treating pt as a screen unit. pt is a print unit (1/72 inch). In CSS, using pt for screen layout works but is unconventional and confusing. Use px or rem for screen layouts; pt for @media print stylesheets.

International and regional variations

UnitFull nameReferenceTypical use
pxCSS pixel1/96 CSS inch (W3C)Screen layout, border widths, icon sizes
remRoot emRoot element font sizeTypography, spacing (recommended for font sizes)
emParent emNearest parent font sizePadding/margin proportional to local text size
ptPostScript point1/72 CSS inch (W3C)Print stylesheets, design tool exports, PDF

Quick reference (base font size = 16 px)

pxrempt
100.6257.5
120.759
140.87510.5
16112
181.12513.5
201.2515
241.518
32224
48336
px (browser default is 16 px)
Pixels (px)px
Root ems (rem)rem
Ems (em)em
Points (pt)pt

1 rem = 1 em = 16 px at the current base size. 1 pt = 1.3333 px (W3C CSS).

Frequently Asked Questions

What is 1 rem in pixels?
1 rem equals the font size of the root HTML element. Browser default is 16 px, so 1 rem = 16 px by default. Change the base font size in this tool to match your design system.
What is the difference between rem and em?
rem (root em) is always relative to the root HTML element's font size. em is relative to the nearest parent element's font size. At the root level they are equal; in nested elements, em compounds while rem does not.
How many pixels is 1 point (pt)?
Per W3C CSS specification: 1 inch = 72 pt and 1 inch = 96 CSS px. Therefore 1 pt = 96/72 px ≈ 1.333 px. This is the CSS reference pixel — actual screen pixels per CSS pixel vary by device DPI.
Should I use px, rem, or em for font sizes?
rem is recommended for font sizes: it respects the user's browser font size preference, avoids cascade issues, and scales consistently. px overrides browser preferences. em is useful for spacing proportional to local font size.
What base font size does Tailwind use?
Tailwind CSS uses 16 px (1 rem = 16 px) as the default, following browser convention. If your project sets a different root font size via CSS, update this converter's base value to match.

Sources

  1. W3C CSS Values and Units Module Level 4 — Absolute Lengths[archived 2026-05-28]

Related Tools