PX and REM converter

Convert between PX and REM in both directions using an explicit root font size and rounding policy.

Numbers: 0–9, ٠–٩ or ۰–۹, with a decimal point or ٫. No exponents or grouping separators. Local processing without uploads or automatic storage. Output up to 16 KiB.

Value −10⁶ to 10⁶, font base 0.1–256px, up to 6 input decimal places. Exact rational decimal calculation, then rounding to 6 places with ties away from zero; trailing zeroes are removed. REM uses the root font size you choose, not your device setting.

How to use

Choose direction and enter the value and desired actual font base. Generate, review the output unit and rounding notice, then copy or download the value with its unit.

Try an example

24px with a 16px base equals 1.5rem. In reverse, −1.5rem with a 20px base equals −30px. The initial base of 16 is editable, not a universal rule.

Support & limits

PX-to-REM divides by the base; the reverse multiplies by it. Decimal fractions use BigInt, then round to 6 places with ties away from zero, removing trailing zeroes and negative zero. Exponents and grouping separators are rejected; Western, Arabic-Indic and Persian digits and ٫ are accepted. Maximum absolute output is 256000000px or 10000000rem, depending on direction. The tool does not measure actual CSS, zoom or device font settings, and does not convert context-dependent EM.

Common questions

Does 1rem always equal 16px?

No. REM is relative to the root element’s font size. Enter your page’s base; the initial value of 16 does not detect the user’s setting.

Related tools