The loop representation plays an important role in canonical quantum gravity because loop variables allow a natural treatment of the constraints. In these lectures we give an elementary introduction to (i) the relevant history of loops in knot theory and gauge theory, (ii) the loop representation of Maxwell theory, and (iii) the loop representation of canonical quantum gravity.