CSS Unit Converter

Convert between CSS units (px, em, rem, %, pt) with live calculations.

Enter a value in any CSS unit and see its equivalent in every other unit, with a live root-font-size control so you can preview how your design behaves at different zoom levels and accessibility settings.

Common use cases: translating designer-supplied pixel values into rem for a scalable design system, computing the percentage equivalent of a parent-based width, double-checking that a 1rem value lands where you expect, and teaching the relationship between viewport, font, and percentage units.

Conversion

PX
%
PT
EM
REM

CSS Units Guide

Pixels - Fixed absolute unit
PX
Percent - Relative to parent
%
Points - 1/72 of an inch
PT
Relative to font-size of element
EM
Relative to root font-size (16px)
REM

Frequently asked questions

When should I use rem vs em vs px?
Use rem for most sizes — they scale with the user's root font size, so users who bump their browser zoom or font size get a proportionally scaled UI. Use em when something should scale with its parent's font size (often inside components). Use px for things that shouldn't scale at all (1px borders, shadow offsets).
Why does 1rem default to 16px?
Because the browser default root font size is 16px. If you set html { font-size: 18px }, 1rem becomes 18px. Some sites use html { font-size: 62.5% } so 1rem = 10px and math becomes easier — at the cost of inheriting weird defaults elsewhere.
What's the difference between % and em for nested elements?
Both are relative to the parent — but % in a property like width is relative to the parent's width, while em is always relative to font size. For typography use em; for layout dimensions, prefer % or modern container/viewport units.
What about vw, vh, dvh — should I use them?
Viewport units (vw, vh) are great for full-screen elements. On mobile, prefer the new dynamic equivalents (dvh, svh) for heights — they account for the browser's collapsing toolbar, which old vh doesn't.