PX to REM Converter

1rem16px at 16px root
Pixelsrem (16px root)Typical use
40.25Hairline gaps
80.5Icon padding
120.75Small labels
161Body text default
201.25Large body
241.5H3 headings
322H2 headings
483Hero headings
rem scales with the root font-size, so a rem-based layout respects the user's browser font setting - the accessibility argument per the MDN values and units reference. The conversion is division: rem = px ÷ root size (16px by default in every browser). The honest nuance: px is deterministic and pixel-perfect for borders and shadows; rem is for anything typographic. Mixing them is normal - borders in px, everything text-adjacent in rem. Bottom line: if a user zooms text and your layout ignores it, that is px typography - and it is an accessibility failure, not a style choice. Related tools: media queries table, display table, and box model table.

The conversion is one division: rem = px รท root font size. With the browser default of 16px, 24px is 1.5rem and 12px is 0.75rem - but the root size is a setting, not a constant, and users change it. The converter above takes any root size so you can verify a design against the accessibility setting your readers actually use.

Bottom line: rem is the right unit for anything typographic - font sizes, spacing around text, layout widths that should scale with reading comfort - because rem respects the user's browser font preference. Pixel typography ignores that setting entirely: a user who sets 20px base text gets your hardcoded 16px anyway, which is an accessibility failure dressed as a style choice.

The honest part: px still wins for hairline borders, box shadows, and 1px separators - cases where scaling with user preferences would distort the design. Teams mix them deliberately: borders in px, everything text-adjacent in rem. The table shows the standard conversions at the 16px default; check your own root size with the input above.

How to use

  1. Enter the pixel value and the root size (16px default) - the rem result updates live.
  2. Use the table for the standard scale at the default root: the 4-px steps map to clean quarter-rems.
  3. Copy the rem value into your stylesheet; keep the px value only for non-scaling details like hairline borders.

Frequently asked questions

How do I convert px to rem manually?

Divide by the root font size: rem = px รท root. At the 16px default, divide by 16 - 32px is 2rem, 8px is 0.5rem. The mental shortcut at 16px: every 4px is 0.25rem, so the standard spacing scale (4, 8, 12, 16) maps to quarter-rems. If the site changes its root (html { font-size: 62.5% } makes it 10px for easier math), every conversion shifts - which is why the converter takes the root as an input.

Why use rem instead of px for font sizes?

Respect for the user's settings. Browser font-size preferences and page zoom change the root size; text sized in rem scales with them, text sized in px does not. A low-vision user who sets a 24px base gets your rem-based paragraph at 24px - and your px-based label stuck at 14px, broken relative to everything around it. Modern browsers zoom whole pages by default, which masks the problem; text-only zoom and user stylesheets expose it.

When should I keep px?

For values that should NOT scale with the reader's text preference: 1px hairline borders and separators, box shadows, and sometimes media-query breakpoints (though em-based breakpoints have their own advantage - they track the user's setting). A 1px border at 200% text zoom is still exactly what the design wants at 1px. The discipline is intent: scaling units for things that read, fixed units for things that frame.

What is the difference between rem and em?

Both scale with font size - but rem is always relative to the ROOT (html) font size, while em is relative to the CURRENT element's computed font size. In a component whose font-size changes, em values cascade unpredictably (padding in em grows with the text); rem values stay predictable everywhere. The common convention: rem for spacing and sizes, em only when the scaling SHOULD compound - like the horizontal padding of a button that widens with its label.

Related tools