40 PX to REM

Open PX to REM converter

Result

40 px = 2.5 rem


Explanation

  • REM — 2.5
  • Pixel base — 16

To convert 40 pixels to REM with pixel's base 16 you need to divide pixels value by base value, in our case: 40 / 16. In result we'll receive that 40 pixels with base 16 is equal to 2.5 rem

40 / 16 = 2.5 rem

CSS code for 40 PX to REM

p { font-size: 2.5em }

HTML (inline CSS):

<p style="font-size: 2.5em">Hello World<p>