If you look at the sky on a night when multiple planets are visible, you will notice they all travel more or less along the same path. This imaginary line is called the ecliptic and it is the plane that the orbits of all the objects in the Solar system follow.
So, if all the orbits are on a single plane, is the Solar system flat?
Yes. The Solar system is flat. Or at least flat-ish. The orbits of the planets in the Solar system are within 3 degrees of the same plane. Only the objects that are farther away from the Sun, like Pluto and the asteroids in the Kuiper belt deviate more, but only up to 30 degrees.
If you were to look at the Solar system from the side while it was forming it would have resembled a miniature galaxy, with a lot of gas and dust on a flat surface. Kind of like a stellar pancake.
On a side note, the ecliptic plane is the same line that ancient Greeks used to make up the zodiac. That is because the twelve constellations that form it, happen to be located across the same path.
But wait, doesn’t gravity tend to form spherical objects like planets and stars? if the gravitational force of the Sun is what keeps the Solar system together, how come this isn’t shaped like a sphere? Why is the Solar system flat?
The Solar system is flat because of the law of conservation of angular momentum. When the Solar system was created out of a huge cloud of gas and dust, the particles started to collide with each other due to gravity. Most of the mass accumulated near the center, creating the Sun. When the rest of the particles collide in every direction, the “up” and “down” movements started to cancel each other out so all the mass had no choice but to align across the plane perpendicular to the rotation axis of the central mass (the Sun).
This creates a spiral of gas and dust that is called a protoplanetary disc. Out of that disc, the planets would eventually form.
The same logic applies to why most galaxies are flat, except in that case, the disc forms around a supermassive black hole.
Gravity only shapes objects into a sphere when the mass blends together.
As far as we know, the other star systems in the universe follow the same general formation process and end up arranging into a flat disc as well with a few minor variations here and there.
Thanks to technology employed by observatories like the ALMA observatory in Chile, we have been able to observe protoplanetary discs that are just starting to form into planetary systems. This has helped proved all these theories correct about the origin of these systems and why they end up being flat.
The image below ghows the star HL Tauri, located 450 light-years away in the Taurus molecular cloud region. This is a very young star that is less than 100,000 years old and is just starting to form a planetary system around it. In the image you can see the cloud of gas and dust around it that will probably collide together to form planets, asteroids, moons and all kinds of objects. The same elliptical, flat shape of our Solar system can be appreciated.