Viscosity in gases arises principally from the molecular diffusion that transports momentum between layers of flow. An elementary calculation for a dilute gas at temperature  and density  gives
where  is the Boltzmann constant,  the molecular mass, and  a numerical constant on the order of . The quantity , the mean free path, measures the average distance a molecule travels between collisions. Even without a priori knowledge of , this expression has nontrivial implications. In particular, since  is typically inversely proportional to density and increases with temperature,  itself should increase with temperature and be independent of density at fixed temperature. In fact, both of these predictions persist in more sophisticated treatments, and accurately describe experimental observations. By contrast, liquid viscosity typically decreases with temperature.
For rigid elastic spheres of diameter ,  can be computed, giving
In this case  is independent of temperature, so . For more complicated molecular models, however,  depends on temperature in a non-trivial way, and simple kinetic arguments as used here are inadequate. More fundamentally, the notion of a mean free path becomes imprecise for particles that interact over a finite range, which limits the usefulness of the concept for describing real-world gases.