rem always references the root element, not the parent. Change the base size once to see how Tailwind, spacing systems, and WCAG targets shift.

The CSS rem unit is relative to the root element (html) font size. By default, browsers set this to 16px, so 1rem = 16px. Unlike em, rem does not compound — it always references the root.
Rem is the recommended unit for modern responsive web design. It provides consistent, scalable sizing that respects user accessibility preferences.
Converting rem to px helps understand the actual rendered size when designing or debugging CSS layouts.
All calculations run locally in your browser — nothing is sent to any server.
px = rem × root font size. Default root font size = 16px.
If html { font-size: 62.5% }, root = 10px, so 1.6rem = 16px.
Rem never compounds. 1rem is always the same regardless of nesting depth. This makes it more predictable than em.
| Feature | rem | px |
|---|---|---|
| Reference | Root font size | Fixed pixel |
| Compounds | No (always root) | No |
| Responsive | Yes | No |
| Accessibility | Respects user settings | Fixed size |
| Predictability | Consistent everywhere | Always consistent |
By default, 1rem = 16px (browser default root font size). If you or Tailwind set html { font-size: 62.5% }, then 1rem = 10px. Always check your :root declaration before assuming 16px.
rem always references the root element (html) font size and never compounds. em references the parent element and compounds through nesting — a 1.5em inside a 1.5em parent renders at 2.25× root. rem is more predictable for spacing systems.
Use rem for typography, spacing, and layout so that values scale with the user's browser font preferences. Use px for borders, box-shadows, outlines, and anything that should stay physically fixed regardless of zoom level.
Tailwind spacing scale uses 0.25rem increments: p-1 = 0.25rem (4px), p-2 = 0.5rem (8px), p-4 = 1rem (16px), p-8 = 2rem (32px). You can change the base font size in tailwind.config.js under theme.fontSize to shift all rem values.
Use html { font-size: 18px; } or html { font-size: 112.5%; } in your global stylesheet. Setting a percentage respects user browser preferences — 62.5% makes 1rem = 10px for easier math, but 100% (16px) is the accessible default.
System UI fonts (font-family: system-ui) render at the OS default size, which browsers map to 16px by default. Since rem is anchored to that root, your rem-based layout adapts correctly across macOS, Windows, and iOS without any adjustments.
Yes, but only if you use em/rem in media queries (e.g. @media (min-width: 48rem)). Some browsers evaluate media query em/rem against the user's browser base size, not your html font-size declaration — so 48rem may equal 768px regardless of your CSS root.
Yes. All calculations run in your browser. No data is sent to any server.

Have an idea, found a bug, or want to suggest a feature? Drop us a message – we respond within 24 hours.