The solar system formed from a large rotating cloud of dust and gas called the solar nebula. As the nebula collapsed, a section broke off to form the sun at the center, with planetesimals - small particles that formed the planets - orbiting around it. The inner planets of Mercury, Venus, Earth and Mars are smaller and more dense than the outer gas giants of Jupiter, Saturn, Uranus and Neptune. While the inner planets are rocky, the outer planets are large balls of gas.