HohoTools

PX to REM Converter

This free px to rem converter helps front-end developers switch between pixels and rems without mental math: type a px value to get rem, or type a rem value to get px, and the two fields stay linked as you type — the side you are editing is never rewritten.

Common values at the current root size

pxrem
40.25
80.5
120.75
161
241.5
322
483
644

How to use

  1. Type a value in the px field to get rem, or in the rem field to get px — the fields update as you type.
  2. Set the root font size your stylesheet uses (8–32 px, default 16); every result and table row recalculates.
  3. Read common conversions at a glance from the reference table, which tracks the current root size live.
  4. Invalid input or an out-of-range root size reports an explicit error instead of a silently wrong value.

Frequently asked questions

What formula does the converter use?

rem = px ÷ root font size and px = rem × root font size. With the default 16 px root, 24 px becomes 1.5 rem. Results are rounded to 4 decimals for rem and 2 decimals for px, which matches the precision typically used in stylesheets.

Which root font size should I use?

The one your CSS actually sets on the html element — most projects keep the browser default of 16 px, but any value from 8 to 32 px can be configured. Picking the real value matters: rem is always relative to the root, so a 20 px root changes every conversion.

How do the two input fields stay linked?

The field you are editing drives the conversion and is never rewritten; the other field always shows the converted result. Clicking or tabbing into the other field makes it the active input, and its current value becomes the new starting point.

Why does the reference table update when I change the root size?

The table lists common pixel values (4, 8, 12, 16, 24, 32, 48, 64) converted at the current root font size. Because every rem value depends on the root, the whole table recomputes live so you can compare scales without retyping anything.

What happens with invalid input?

The tool fails fast: a non-numeric value or a root size outside 8–32 px shows an explicit error instead of silently falling back to a default. Partial input such as a lone minus sign reports the same way until it becomes a valid number.

Is my data uploaded anywhere?

No. The conversion is a simple local calculation in your browser tab — nothing is sent to a server, stored or logged, and the inputs disappear when you close the page.

Related tools

About this tool

This free px to rem converter helps front-end developers switch between pixels and rems without mental math: type a px value to get rem, or type a rem value to get px, and the two fields stay linked as you type — the side you are editing is never rewritten. The root font size is configurable from 8 to 32 pixels with 16 as the default, so every result matches the typography scale your stylesheet actually uses instead of an assumed standard. A reference table of common values — 4, 8, 12, 16, 24, 32, 48 and 64 px — recalculates live under the current root size, which makes it easy to check whether a spacing or type scale stays on a clean rhythm. The tool fails fast: non-numeric input and out-of-range root sizes produce an explicit error rather than a silently wrong number, so a typo can never sneak a bad value into your CSS. The conversion itself is a single division or multiplication that runs locally in your browser: nothing is uploaded, stored or logged, and the page keeps working offline once it has loaded.