A dense hydrogen-rich cloud of gas and dust contracts under gravity. As the gas gets compressed, its temperature increases and the dust cloud begins to spin. A protostarThe initial stage of a star's life, just before nuclear fusion begins. begins to form at the centre of this spinning dust cloud. nuclear fusionThe joining together of two smaller atomic nuclei to produce a larger nucleus. Radiation is released when this happens. Nuclear fusion happens in stars like our Sun, and in hydrogen bombs. starts, and a star is born. The planets begin to form from the swirling dust clouds around the star.
Gravity is greater closer to the star. Most of the dense material in the dust cloud is attracted strongly and ends up here.
The inner rocky planets and the gas giants
The inner four planets (Mercury, Venus, Earth, and Mars) are rocky and have solid surfaces that can be walked on.
When the solar system formed, rocks (and other dense, heavy materials in the dust cloud such as iron and uranium) tended to gather closer to the Sun, and these materials combined together to form the inner planets.
The outer four planets (Jupiter, Saturn, Uranus, and Neptune) are called gas giants. When the solar system formed, gaseous substances gathered together further away from the Sun and formed the gas giants.