The number of air molecules above a surface changes as the height of the surface above the ground changes. For example, there are fewer air molecules above the 50 kilometer (km) surface than are found above the 12 km surface. Since the number of air molecules above a surface decreases with height, pressure likewise decreases with height.
Most of the atmosphere's molecules are held close to the earth's surface by gravity. Because of this, air pressure decreases rapidly at first, then more slowly at higher levels.
Since more than half of the atmosphere's molecules are located below an altitude of 5.5 km, atmospheric pressure decreases roughly 50% (to around 500 mb) within the lowest 5.5 km. Above 5.5 km, the pressure continues to decrease, but at an increasingly slower rate (to about 1 mb at 50 km).