px to rem Converter — CSS px, rem, em & pt
Convert any CSS length between px, rem, em, and pt instantly. Set your own root font-size, copy the paste-ready value in one click, and use the live px→rem reference table below. Runs entirely in your browser — no signup, no upload.
How it works
Every conversion routes through px as a pivot unit: the tool first turns your input into pixels, then turns those pixels into the unit you want. That keeps the math consistent no matter which of the four units you convert between, and it matches how a browser resolves lengths.
The two font-relative units come from the W3C CSS Values and Units Module Level 4. A rem is measured against the rootelement's font-size (the :root / html element, 16px by default), while an em is measured against the nearest element's own font-size, which is why nested ems compound. The tool exposes both bases separately so the two are never conflated:
- from rem: px = value × rootFontSize
- from em: px = value × elementFontSize
- to rem: result = px ÷ rootFontSize
- to em: result = px ÷ elementFontSize
The two absolute units use the fixed ratios defined for CSS absolute lengths: 1in = 96px and 1pt = 1/72in. Combining them gives 1pt = 96/72 px = 1.3333px and its inverse 1px = 0.75pt. Because these are constants written into the CSS specification — not rates that change — the converter is fully deterministic and never goes stale.
Results are rounded to four decimal places and trailing zeros are trimmed, so 1.5000 shows as 1.5. As an internal check, every conversion is run forwards and then backwards through the pivot; the two must agree before the answer is shown, which is the “round-trip cross-check passes” note under the result. The pt path is additionally verified through the explicit inch chain (pt ÷ 72 × 96) so both routes to px must match.
Worked examples
Frequently asked questions
Sources & references
- W3C — CSS Values and Units Module Level 4: Absolute lengths (1in = 96px, 1pt = 1/72in)
- W3C — CSS Values and Units Module Level 4: Font-relative lengths (em, rem)
- MDN Web Docs — CSS <length> data type
The CSS unit ratios on this page were last cross-checked against the W3C specification and MDN on 2026-07-01. These ratios are fixed CSS constants, so they are stable across browser and spec revisions.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, edge case, or want to suggest an improvement?
Email me at [email protected] — most fixes ship within 24 hours.