rem (CSS unit)

The rem is a CSS unit relative to the root font size, so 1rem usually equals 16px; it scales type and spacing consistently and helps accessibility.
Design
Created on
23.08.2026

Summarize this

The rem is a CSS unit relative to the root font size, the size set on the html element. Since browsers default that to 16 pixels, 1rem usually equals 16px, 1.5rem equals 24px, and so on. Because every rem value scales from one root, it keeps type and spacing consistent and respects the user's own font-size setting, which makes it a cornerstone of accessible, responsive design.

How rem is calculated

A rem is always the root font size multiplied by the number. If the html element is 16px, then 2rem is 32px. Change the root once and everything sized in rem scales with it.

  • html { font-size: 16px; } means 1rem = 16px.
  • font-size: 1.25rem; resolves to 20px.
  • Setting html { font-size: 100%; } keeps the browser default and honours the user's preference.

rem versus em versus px

Choosing the right unit comes down to what it is relative to.

UnitRelative toScales with user font sizeBest for
pxNothing (fixed)NoBorders, fine details
emCurrent element font sizeYes, but compoundsSpacing tied to local text
remRoot font sizeYesType scale, global spacing

Why rem helps accessibility

When a user raises the default text size in their browser, everything sized in rem grows with it, because it all derives from the root. Sizing in fixed pixels ignores that choice and can make a site unreadable for people who need larger text, which is also a WCAG concern. rem is the simplest way to honour the user's preference site-wide.

Building a scale with rem

rem is the go-to unit for font sizes and for a consistent spacing scale. A common pattern is a small, repeatable set (0.5rem, 1rem, 1.5rem, 2rem, 3rem) used for margins, padding and gaps, which keeps rhythm harmonious and easy to reason about across a whole design system.

Common pitfalls

Avoid the old font-size: 62.5% trick that forces 1rem = 10px: it makes maths easier but can clash with user settings and third-party styles. Keep px for hairline borders where scaling is unwanted, and reach for em when spacing should follow a component's own font size rather than the root.

rem at BeBranded

At BeBranded we size type and spacing in rem so a site scales cleanly and stays accessible when users adjust their text size. It is part of the accessible, systematic front-end in our design work.

FAQ

The rem is a CSS unit relative to the root font size set on the html element. Since that defaults to 16 pixels, 1rem usually equals 16px and scales type and spacing consistently.
em is relative to the current element's font size, so it compounds when elements are nested. rem is relative only to the root, so it stays predictable at any depth.
px is a fixed value that ignores the user's browser font-size setting. rem scales from the root font size, so it respects that setting and is better for accessibility.
By default 1rem equals 16 pixels, because browsers set the root font size to 16px. If the root or the user changes that value, every rem scales with it.
Because rem scales with the user's chosen text size. When someone enlarges the default font, rem-based type and spacing grow too, keeping the site readable.
Yes. Webflow lets you set sizes in rem in the Designer, so you can build type and spacing that scale from the root font size.

Ready to boost your conversions?

Our team is here to understand your needs & work with you to create your next projects.
Get news, infos and resources.
Actionable tips delivered straight to your inbox.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.