How does density change in the atmosphere?
Air density decreases with height.
We can define air density as the number of air molecules per unit volume. Near sea level, there are about 2.7× 10¹⁹ molecules per cubic centimetre.
Gravity holds air molecules near the earth. In other words, air has weight. Also, gases like air are easily compressed.
The weight of all the air above a given point in the atmosphere squeezes air molecules closer together. This causes the density to increase. The more air above a level (and hence the more weight of air above a level), the greater the compression.
Air density is greatest at the surface, where the weight of the entire atmosphere above compresses the air below.
Air density decreases as we move up in the atmosphere because the weight of air above becomes less. Hence there is less compression.