Convert pixels to rem and back at any root font size — with the common pairs listed and the accessibility reason rem exists.
Why rem exists at all
Pixels are absolute; rem is relative to the root font size — 16 px in almost every browser’s default. Sizing in rem means the whole layout scales when a user raises their browser’s base font size, which is an accessibility feature, not a styling fashion. This converter goes both directions at any root size, for the codebases that changed the default.
How to use it
- Enter the value and the direction (px → rem or rem → px).
- Set the root font size if your project changed it from 16.
- Read the conversion and the common pairs.
The formula
A worked example
At the default 16 px root, 24 px is 1.5 rem — and the pairs worth memorising are 16 → 1, 24 → 1.5, 32 → 2. The classic “62.5% trick” sets the root to 10 px so 1.6 rem = 16 px, trading spec-default purity for round numbers; enter 10 as the root here and the conversions follow.