Skip to content
Orpheus

PX to REM Converter

Convert pixel values to rem, or back, against any root size.

Options
Direction
px

The browser default is 16px. Change it only if you have actually changed the root, not the body.

Result

Everything is processed in this tab. Nothing you paste is sent anywhere.

Every tool runs entirely in your browser. Your files are never uploaded to a server.

One rem equals the root font size, which is 16px by default, so 24px is 1.5rem. Dividing a pixel value by the root gives rem; multiplying by it gives pixels back.

How to use PX to REM Converter

  1. Paste your values. One per line, or a whole declaration such as padding: 32px 8px — every number in it is converted.
  2. Set the root font size. Leave it at 16 unless you have genuinely changed the size on the html element.
  3. Copy the result. Switch direction to convert rem back to pixels against the same root.

About converting CSS units

The rem exists to solve a specific accessibility problem. Browsers let a reader change their default font size, and a substantial number of people do — for eyesight, for a distant screen, or simply from preference. A layout built in pixels ignores that setting entirely, because a pixel is a pixel whatever the reader asked for. A layout built in rem scales with it, because one rem is defined as the root font size, so changing the root changes everything derived from it in proportion. The default root is 16px in every major browser, which makes the conversion straightforward: divide by 16 to get rem, multiply by 16 to get pixels. A common shortcut sets the root to 62.5 percent so that one rem equals ten pixels and the mental arithmetic disappears — but that shortcut works by overriding the reader chosen size, which defeats the purpose of using rem in the first place. Converting properly costs nothing once a tool does it for you. The other unit worth understanding alongside rem is em, which is relative to the element own font size rather than the root. That makes em compounding: a 0.9em inside a 0.9em inside a 0.9em is 0.729 of the original, which is how text ends up mysteriously tiny four levels deep. Use rem for anything that should be consistent and em for things that should scale with their immediate context, such as padding inside a button that should grow with its label.

Frequently asked questions

What is 16px in rem?
Exactly 1rem at the default root size, because one rem is defined as the root font size and browsers default that to 16px. 24px is 1.5rem, 12px is 0.75rem, and 8px is 0.5rem.
What is the difference between rem and em?
A rem is always relative to the root element, so it is the same everywhere. An em is relative to the font size of its own element, so nested elements compound — three levels of 0.9em is 0.73, not 0.9.
Should I set html { font-size: 62.5% } to make 1rem equal 10px?
It makes the arithmetic easier and overrides the size the user chose in their browser settings, which is exactly what rem exists to respect. Converting properly costs nothing and keeps that preference intact.
Why use rem instead of pixels at all?
Because a pixel value ignores the reader font-size preference and a rem scales with it. Someone who has set a larger default gets larger text automatically, which is a genuine accessibility difference rather than a stylistic one.
Should borders be in rem?
Usually not. Hairline borders and one-pixel rules are meant to stay crisp rather than scale, so pixels are the right unit there. Type, spacing and container widths are what benefit from rem.

Last updated