Why is the Sun's density less than the inner planets? The density of the Sun is $1410~\frac{\text{kg}}{\text{m}^{3}}$ and Mercury's is $5430~\frac{\text{kg}}{\text{m}^{3}}$, but shouldn't the Sun be denser? Because when the Solar System was forming, there was a big disk of debris, and depending on the density of the debris it went closer or further from the centre, which then formed the planets, but the Sun is in the centre, and it's less dense than Mercury, why?
The sun isn't the same density all the way through.

According to MSFC's solar interior page, the core density at the centre of the sun is a whopping 150,000 kg/m$^3$. Surrounding it the radiative zone is around 20,000 - 200 kg/m$^3$ (already less dense than water). Eventually at the edge is the convective zone - the density at the part that we see is much less dense than our own air...

So although the Sun's average density isn't very remarkable, the core is the densest place in the solar system.

(Sun cross section from Wikipedia.org)