Scientists believe that the solar system in about 4.6 billion years old. Earth and the rest of the solar system formed from a giant cloud of gas and dust. Gravity and rotational forces caused the cloud to flatten into a disc and much of the cloud’s mass to drift into the center. This material became the Sun. The leftover parts of the cloud formed small bodies called planetesimals.
These planetesimals collided with each other, gradually forming larger and larger bodies, some of which became the planets. This process took approximately 25 million years, according to scientific estimates.