Quick answer: To convert px to rem, type a pixel value, check your root font size — 16 px is the browser default — and read the rem value: rem equals pixels divided by the root font size. So 24 px at a 16 px root is 1.5 rem. This tool does the maths instantly, works both ways (rem to px too), and shows a table of common sizes.
Pixels are absolute: 16 px is always 16 px. REM and EM are relative, which is why modern CSS prefers them — they grow and shrink with the user's font settings, so a page stays readable for people who enlarge text. The catch is the conversion: every size has to be divided by the root font size, and doing that by hand for a whole stylesheet is slow and error-prone. This tool converts px, rem and em instantly, with any root size you set.
What Are REM and EM?
REM stands for root em: one rem equals the font size of the root element, which browsers set to 16 pixels unless the page changes it. So 1 rem is normally 16 px, 1.5 rem is 24 px and 0.5 rem is 8 px. EM is similar, but it is relative to the parent element instead of the root — so an em inside an element with a 20 px font is 20 px, and em values inside nested elements multiply, which is why em can surprise people. REM is the safer default for font sizes and spacing, because it always means the same thing everywhere on the page.
How to Convert PX to REM
Converting takes four steps:
- Type a pixel value, for example 24.
- Check the root font size — 16 px is the browser default.
- Read the rem value: 24 px at a 16 px root is 1.5 rem.
- To go the other way, switch the unit to rem and read the pixel value.
The Formula
The maths is one division: rem equals px divided by the root font size, and px equals rem multiplied by the root font size. At the usual 16 px root, 8 px is 0.5 rem, 12 px is 0.75 rem, 16 px is 1 rem, 24 px is 1.5 rem, 32 px is 2 rem and 48 px is 3 rem — the table on this page lists them all for the root size you set. For em, divide by the parent element's font size instead of the root: 24 px inside a 20 px parent is 1.2 em. If your site sets a different root size — some designs use 10 px to make the maths easy — change the root field here and every value updates.
When to Use REM Instead of PX
Use rem for font sizes, line heights, padding and margins — anything that should scale when a reader enlarges the text in their browser settings. That is also an accessibility win: users who need larger text get a page that grows with them, instead of a layout that breaks. Pixels are still fine for things that should never scale, like a 1 px border or a hairline divider. A common pattern is rem for type and spacing, px for borders — and if you use Tailwind CSS, its spacing scale is already built on rem, so this converter matches the values you see there.
Frequently Asked Questions
1. How do I convert px to rem?
Divide the pixels by the root font size. At the usual 16 px root, 24 px is 1.5 rem. Type the value here and the tool does it instantly.
2. What is the default root font size?
16 pixels in every browser, unless the page sets a different size on the root element. If your site changes it, enter your root size in the tool.
3. What is the difference between rem and em?
REM is relative to the root element, so it means the same everywhere. EM is relative to the parent element, so nested em values multiply — 1.2 em inside 1.2 em is 1.44 em of the root.
4. Can I convert rem back to px?
Yes. Switch the unit to rem, type the value, and the tool shows the pixel size — rem multiplied by the root font size.
5. Is it free? Do I need an account?
Yes, it is free, with no signup and no account. Everything is calculated in your browser.
Last updated: December 4, 2026 · About GetToolset · Privacy