Convert a CSS size between pixels, em, rem, points, and percent, based on your chosen base font size.
CSS supports several sizing units: px is an absolute pixel value, em and rem scale relative to a font size (element or root respectively), pt is used mainly in print styles, and % scales relative to the parent.
Pixels = em or rem value × Base Font Size | Points = Pixels × (72 ÷ 96)
24px with a 16px base font size equals 1.5em / 1.5rem, or 18pt.
Common ones include px (pixels), em, rem, %, pt, and viewport units like vw/vh.
em is relative to the font size of its parent element (compounding in nested elements); rem is relative to the root (html) element's font size, making it more predictable.
Relative units like rem scale better with user accessibility settings (like browser zoom or font-size preferences), improving responsiveness and accessibility.