PX to REM Converter
Convert pixel values to rem, or back, against any root size.
The browser default is 16px. Change it only if you have actually changed the root, not the body.
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
- Paste your values. One per line, or a whole declaration such as padding: 32px 8px — every number in it is converted.
- Set the root font size. Leave it at 16 unless you have genuinely changed the size on the html element.
- 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?
What is the difference between rem and em?
Should I set html { font-size: 62.5% } to make 1rem equal 10px?
Why use rem instead of pixels at all?
Should borders be in rem?
Last updated