PX to REM Converter

In short: rem = px ÷ root size. At the standard 16 px root, 24 px = 1.5 rem (also 150%, and 18 pt in print terms). Edit either the px or the rem box — the other follows.

The quick table (16 px root)

4 px = 0.25 rem · 8 px = 0.5 rem · 12 px = 0.75 rem · 14 px = 0.875 rem · 16 px = 1 rem · 18 px = 1.125 rem · 20 px = 1.25 rem · 24 px = 1.5 rem · 32 px = 2 rem · 40 px = 2.5 rem · 48 px = 3 rem · 64 px = 4 rem. Most design spacing scales live on the multiples of 4 px, which is why the same rem fractions — 0.25, 0.5, 0.75, 1, 1.5, 2, 3 — recur through every mature stylesheet: they are the 4-point grid wearing relative units.

Working the other way, the fractions worth recognising on sight: 0.0625 rem = 1 px (hairlines), 0.875 rem = 14 px (small text), 1.125 rem = 18 px, 1.25 rem = 20 px (large body text), 2.25 rem = 36 px. When a value converts to an ugly decimal — 13 px = 0.8125 rem — that is usually the design telling you the pixel value itself was arbitrary; rounding the design decision beats preserving the accident in four decimal places.

Converting a whole stylesheet: the workflow

Migrating a legacy pixel stylesheet is a search-and-judgement job, not a blind replace. The safe order: first set (or confirm) the root size and leave it alone; then convert font sizes, line heights and spacing values — the properties users feel when they scale text; then layout dimensions that are genuinely proportional, like container paddings; and stop before the hairlines — 1 px borders, outline offsets and box-shadow offsets usually stay in px deliberately. Work component by component and screenshot-compare at 100% and at a 200% browser font setting: the second view is the entire point of the exercise, and a conversion that only checks the first has done the arithmetic and skipped the purpose. Values that convert to long decimals are a prompt to adopt the design system's nearest step, not to paste four decimal places into production CSS.

Print designers converting in the other direction should note the one asymmetry: points are absolute physical units, rem is relative to a screen setting — a size specified as 12 pt becomes 16 px becomes 1 rem only at the default root, and the chain breaks the moment a user changes their base size, which is precisely the behaviour accessibility wants.

Frequently asked questions

How do you convert px to rem?

Divide the pixel value by the root font size — the font-size of the html element, which browsers default to 16 px. 24 px / 16 = 1.5 rem. The reverse is a multiplication: 1.5 rem x 16 = 24 px. If a design system sets the root to a different value (10 px via the once-popular 62.5% trick, or 18–20 px on some sites), divide by that instead — this converter's base field exists for exactly that reason. The full working set at the default base: 8 px = 0.5 rem, 14 px = 0.875 rem, 16 px = 1 rem, 32 px = 2 rem, 48 px = 3 rem.

What is the difference between rem and em?

Both are relative to font size, but they anchor differently. A rem is always relative to the root element's font size, so 1.5 rem means the same thing everywhere in the document. An em is relative to the font size of the element's parent (for font-size itself) or of the element (for other properties), so ems compound: nest three elements each set to 1.2 em and the innermost text is 1.2 x 1.2 x 1.2 = 1.728 times the base. That compounding is occasionally useful for components that should scale as a unit, and a classic source of mystery sizing bugs everywhere else — which is why rem is the default recommendation for page-level sizing.

Why use rem instead of px at all?

Accessibility. Users who set a larger default font size in their browser — common among low-vision readers — get a layout that scales proportionally when sizes are in rem, because the root font size itself grows. Pixel-based text ignores the preference entirely and stays stubbornly small. Rem also gives a design one dial to turn: raise the root size at a breakpoint and every rem-based dimension in the layout breathes together. Borders and hairlines are the usual exception — a 1 px rule is meant to be a device pixel, and converting it to 0.0625 rem adds nothing but noise.

What root font size should I use?

Leave it at the browser default of 16 px unless you have a specific reason not to. The 62.5% trick (setting html to 10 px so the division becomes trivial) was popular when calculators were scarce, but it overrides the user's chosen default size and can shrink text for exactly the users who enlarged it. Modern practice: respect the default, define sizes in rem directly in the design system (spacing scales are usually built in rem from the start), and convert legacy pixel values with a tool like this one when migrating an older stylesheet.

How do percentages and points relate to px and rem?

For font-size, a percentage is relative to the parent's size, so 150% at a 16 px base lands on the same 24 px as 1.5 rem does — the difference is the anchor, as with em. Points belong to print: 1 pt is 1/72 of an inch and a CSS pixel is 1/96 of an inch, so points = pixels x 0.75, and 24 px = 18 pt. That conversion matters when a brand guide or a Word document specifies type in points and the website needs the same sizes on screen: convert through inches, not by eye, and expect the screen result to look slightly different anyway because rendering, not arithmetic, governs the final impression.

Related tools

Figures checked on 24 November 2026. Everything is calculated in your browser — nothing you type is sent anywhere.