๐Ÿ“ PX to REM Converter

Type in either box โ€” the other converts instantly. Change the base font size if your project doesn't use the browser default of 16px.

Result24px = 1.5rem
CSSfont-size: 1.5rem;

The formula

rem = px รท base font size. With the browser default of 16px, 24px is 1.5rem and 8px is 0.5rem. That's the entire trick โ€” everything else is knowing when to use which unit.

Why rem beats px for font sizes

Users can raise their browser's default font size โ€” and many people with low vision do. Sizes in rem scale with that preference; sizes in px ignore it. That's why accessibility guidelines and most design systems specify type in rem: your layout respects the reader's settings instead of overriding them. A good rule of thumb: rem for font sizes and spacing that should scale, px for things that shouldn't (borders, hairlines, shadows).

Quick reference (base 16px)

pxrempxrem
40.25241.5
80.5281.75
100.625322
120.75362.25
140.875402.5
161483
181.125563.5
201.25644

FAQ

What about the 62.5% hack?

Setting html{font-size:62.5%} makes 1rem equal 10px, so the math feels easier (1.6rem = 16px). It works, but it breaks assumptions in third-party components and design tokens, so most modern codebases skip it and just divide by 16. Change the base field above to 10 if your project uses it.

Rem vs em โ€” which one?

Rem is relative to the root font size โ€” predictable everywhere. Em is relative to the parent's font size โ€” it compounds when nested, which is occasionally useful (icons that scale with their button's text) and usually a debugging session waiting to happen. Default to rem.

Should media query breakpoints use rem?

It's the safest choice: rem-based breakpoints respond when users zoom or raise their font size, keeping layouts usable. 48rem instead of 768px does the same job with better accessibility behavior.

Steal our 2026 Social Media Sizes cheat sheet

Every platform, every format, always current โ€” plus one short email a month when new tools ship. No spam, unsubscribe anytime.

More burritos ๐ŸŒฏ