Around 4.6 billion years ago, neither the Earth nor any of the other planets existed. There was just this vast, dark, very hot cloud of gas and dust swirling around the newly formed Sun. Gradually, the cloud cooled and the gas began to condense into billions of droplets. Slowly these droplets were pulled together into clumps by their own gravity - and they carried on clumping until all the planets, including the Earth, were formed. But it took another half a billion years before the Earth had cooled enough to form a solid crust with and atmosphere around it.