em

An em is a unit of typography, equal to the currently specified font-size.

p { font-size: 16px } /* 1em = 16px */

html { font-size: 16px }
h1 { font-size: 2em } /* 2em = 16px * 2 = 32px */

rem

rem means root em.

It is a unit of typography equal to the root font-size. This means 1rem is always equal to the font-size defined in html.

rem vs em