Why the lighter gas, nitrogen, does not rise above oxygen in Earth's atmosphere? It is known that the atmosphere consists mostly of oxygen and nitrogen, with oxygen constituting about 21 % and nitrogen 78 %. Since released helium and hydrogen gases rise upwards in the atmosphere, when they are released from a container, one would naïvely think that the lighter nitrogen would rise above oxygen, and then we would have "onion-like" structure of atmosphere, with different shells consisting of different elements. But clearly this is not the case. Why this reasoning fails for nitrogen?
 A: I've always thought this was due to Brownian motion at the molecular level and mixing due to thermal convection.
In other words if the molecules were not jiggling and moving around then they would indeed stratify themselves in terms of density (not mass).
A nice experiment would be to allow a very tall cooled sealed cylinder of air to rest/settle for some time and then test the compositions at the top and bottom.
I suspect that the $O_2/N_2$ ratio does go down slightly with increasing altitude. I would be interested to see some data on this.
https://courses.lumenlearning.com/geophysical/chapter/atmospheric-gasses/
[Although the density of the atmosphere changes with altitude, the composition stays the same with altitude, with one exception. In the ozone layer, at about 20 km to 40 km above the surface, there is a greater concentration of ozone molecules than in other portions of the atmosphere.]
A: I googled a bit, but did not see anything that specifically talks about $N_2$ and $O_2$ separating. Separation of lighter components does occur at altitudes about 100 miles because the mean free path becomes longer than the scale of motion that mixes gases. At this altitude, sunlight creates reactive species. Atomic $O$ becomes a predominant component.
See Atmosphere of Earth and Atmospheric Structure.
