The conformal loop ensemble CLE[subscript κ]with parameter 8/3<κ<8 is the canonical conformally invariant measure on countably infinite collections of non-crossing loops in a simply connected domain. We show that the number of loops surrounding an ε-ball (a random function of z and ε) minus its expectation converges almost surely as ε→0 to a random conformally invariant limit in the space of distributions, which we call the nesting field. We generalize this result by assigning i.i.d. weights to the loops, and we treat an alternate notion of convergence to the nesting field in the case where the weight distribution has mean zero. We also establish estimates for moments of the number of CLE loops surrounding two given points