CSS Tool
Convert between px, rem, em, pt, and % — type in any field and the rest update instantly.
Type a value into any field and the rest update instantly, all relative to the base font size you set (16px by default, which matches most browsers' default). This is the everyday tool for translating a design spec's pixel values into the rem-based sizing modern CSS favors for accessibility.
Pixel values are fixed and don't respond to a user's browser font-size preference, which matters for
accessibility — someone who's increased their default text size for readability won't see any
benefit from a 16px value. rem units scale relative to the root
(html) element's font size, so they respect that preference automatically, which is why most
modern CSS style guides recommend rem for font sizes and spacing.
Both are relative units, but relative to different things. rem is always relative to the
root element's font size, no matter how deeply nested the element is. em is relative to the
current element's own font size (or its parent's, depending on the property), which means em
values can compound unpredictably as you nest elements with different font sizes — a common source
of confusing, hard-to-trace sizing bugs. This calculator treats both the same way for simplicity (relative
to the base font size field), since in the very common case of a flat, non-nested-font-size context, they
behave identically.