About the CSS Font Size Units
The CSS Font Size Unit Converter takes a pixel value and translates it into the other sizing units browsers understand: points, rem, em, and percent. It is built for front-end developers and designers who need to turn a pixel-based design spec into the relative units a stylesheet actually uses, or who are trying to work out why nested text is rendering larger or smaller than expected.
How It Works
Enter a font size in pixels along with the font size of its parent element, which defaults to 16px, the typical browser base size. The calculator multiplies the pixel value by 0.75 to get points, divides it by 16 to get rem, and divides it by the parent size to get em and percent. Because rem always measures against the root element while em measures against the immediate parent, the two only match when that parent's own font size happens to be 16px.
Examples
Default 16px Text
At the default 16px with a 16px parent, the result is 12pt, 1rem, 1em and 100%, since every unit lines up exactly at the browser's base size.
20px Text Inside a 10px Parent
A 20px heading placed inside an element with a 10px font size converts to 15pt and 1.25rem, both fixed relative to the 16px root, but to 2em and 200% relative to its own parent, showing how em and rem diverge once the parent isn't 16px.
Advantages
- Shows rem, em, points and percent side by side from one pixel value, instead of doing four separate manual conversions.
- Makes the difference between rem (root-relative) and em (parent-relative) concrete with an actual number rather than just the general rule.
- Useful for translating a pixel-based mockup into the relative units a maintainable stylesheet should use.
Common Mistakes
- Assuming rem and em will always match, when they only match if the parent element's font size is also exactly 16px.
- Forgetting that a browser or user accessibility setting can change the root font size, which silently changes what a rem value renders as.
- Using em for deeply nested components without accounting for compounding, since each parent's em stacks multiplicatively down the tree.
Edge Cases to Watch For
- If the parent font size field is left at 0 or blank, the calculator falls back to 16px so the em and percent figures do not divide by zero.
- rem is always calculated against a fixed 16px root, so it will read wrong for any project that has changed the html element's own font size away from the browser default.
- Because em compounds with each level of nesting in real CSS, a single em value from this tool describes only one parent-child relationship, not a deeply nested chain.
Common Use Cases
- Front-end developers converting a Figma or Sketch pixel spec into rem-based CSS.
- Designers checking how a font size will scale relative to a component's parent before handing off to development.
- Developers auditing an existing stylesheet by seeing the pixel equivalent of a given rem or em value.