We examine the evolution of the snow line in a protoplanetary disc. If the magneto-rotational instability (MRI) drives turbulence throughout the disc, there is a unique snow line outside of which the disc is icy. The snow line moves closer to the star as the infall accretion rate drops. Because the snow line moves inside the radius of the Earth's orbit, the formation of our water-devoid planet is difficult with this model. However, protoplanetary discs are not likely to be sufficiently ionised to be fully turbulent. A dead zone at the mid-plane slows the flow of material through the disc and a global steady state cannot be achieved. We model the evolution of the snow line also in a disc with a dead zone. As the mass is accumulating, the outer parts of the dead zone become self gravitating, heat the massive disc and thus the outer snow line does not come inside the radius of the Earth's orbit. With this model there is sufficient time and mass in the disc for the Earth to form from water-devoid planetesimals at a radius of 1AU. Furthermore, the additional inner icy region within the dead zone predicted by this model may allow for the formation of giant planets close to their host star without the need for much migration.