Friday, November 6, 2026 · Asia/KarachiFree tools · No signup · Runs in your browser

PX to REM Converter

PX to REM divides a pixel length by a root font size. 24 pixels at a root of 16 is 1.5rem. 30 pixels at a root of 10 is 3rem.

New

The page does not read the browser’s real root. Type the root your stylesheet uses. The rem-to-px page multiplies. This page divides.

How to use

  1. Enter pixels and a root greater than 0.
  2. Press Convert. The formula line names the division.
  3. Reset restores 24 pixels at a root of 16.

Formula / how it works

The division. Rem equals pixels divided by the root, rounded to three decimal places. 24 ÷ 16 is 1.5. 30 ÷ 10 is 3. A root above 200 or not above 0 is refused. The rem to px converter is the inverse. Use both when a token and a pixel fallback must agree. A screenshot should include the root. “1.5rem” alone does not say which root produced it.

Twenty-four pixels at a root of 16 is the same fact as 1.5rem on the rem-to-px page, read backwards. Write both numbers in the note. A reader who sees only 1.5rem will assume a root, often 16, and may be wrong. A reader who sees only 24px has lost the token. The formula line carries the root so a screenshot is complete. Press Convert after you edit either box. The form does not divide while you type. A root of 10 is the 62.5 percent stylesheet. Type 10 there. Do not leave 16 out of habit. Three decimal places stops a repeating quotient from filling the line. If you need more precision, divide yourself and record the extra digits. This page is the visible check, not a build step.

Record the root beside every token you convert. A later edit that changes html font-size without revisiting these notes will make every rem token drift. The three-decimal rounding is a display choice. 24 divided by 16 is exact. 10 divided by 16 is 0.625, which needs no further digits. A quotient such as 100 divided by 6 would show three decimals and drop the rest. If you are matching a design tool that shows four decimals, divide on paper and do not treat the dropped digit as a disagreement about the formula. The formula is only the division. Press the button after each edit. A stale result is the common mistake, not a wrong quotient. Pair this page with the rem-to-px page when a ticket must show both directions of the same token.

A stylesheet that sets the root to 16 pixels makes one rem equal to 16 pixels, so 24 pixels is one and a half rem. A stylesheet that sets the root to 10 pixels makes one rem equal to 10 pixels, so 30 pixels is three rem. Those two pairs are the worked examples on this page. Copy the root from the actual rule, not from memory. If the rule is 62.5 percent, the root is 10 pixels when the browser default is 16, and you type 10. If a component sets its own font size, rem still refers to the root, not to that component. Em would refer to the component. This page does not convert em. Type a pixel length and a root, then press Convert. The result line names both inputs and the quotient. Three decimal places is enough to see 1.5 and 0.625 without a long repeating tail. If your design tool shows a fourth digit, the formula is still the same division. Keep the root in the note you paste into the ticket so the next person does not assume 16. Reset puts 24 and 16 back, which is the first example. Change the root to 10 and the pixels to 30 for the second example. Do not mix the two pairs. A token written as rem without the root is incomplete. A token written as pixels without the rem value is also incomplete when the project has agreed to use rem. The pair is the record.

Write the root in the same note as the rem value. A later reader should not have to open the stylesheet to know whether 1.5rem means 24 pixels.

Worked examples

24 pixels at root 16

Inputs: Pixels: 24 | Root: 16

Leave pixels at 24 and the root at 16, then press Convert. The rem is 1.5.

Result: Pixels: 24 Root: 16 px Rem: 1.5 Formula: rem = pixels ÷ root font size.

30 pixels at root 10

Inputs: Pixels: 30 | Root: 10

Set pixels to 30 and the root to 10, then press Convert. The rem is 3.

Result: Pixels: 30 Root: 10 px Rem: 3 Formula: rem = pixels ÷ root font size.

Use cases

  • Turning a pixel measure into a rem token.
  • Checking a 10px root.
  • Pairing with the rem-to-px page.
  • Keeping the root in the result.

Tips & limitations

  • Type the root you ship.
  • Three decimal places is the rounding.
  • A root of 0 is refused.
  • The browser setting is not read.

FAQ

Why is 24px equal to 1.5rem?

Because 24 divided by a root of 16 is 1.5. A different root gives a different rem.

Does this read my browser font size?

No. It divides the two numbers you type.

What is a 62.5 percent root?

Ten pixels, if the browser default is 16. Type 10.

Can the root be 0?

No. Division by zero is refused.

How is this different from rem to px?

That page multiplies. This page divides.

Is anything uploaded?

No. The division runs in the browser.

Runs entirely in your browser; nothing is uploaded. Check the output before you rely on it in production code, data or security decisions.