PX and REM converter
Convert between PX and REM in both directions using an explicit root font size and rounding policy.
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.
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
Length converter
Convert metric and customary length units.
Grid and Flex layout builder
Generate a bounded CSS layout, a numbered-child preview and a downloadable static HTML example.
Aspect ratio calculator
Reduce an integer ratio exactly, or calculate a missing width or height from a ratio and one known dimension.