The depositional porosities of modern dunes in the Namib Desert are compared to intergranular volumes of ancient sandstone analogs. In situ samples of sand were obtained by impregnating the surface of dunes with superglue. Pleistocene and older eolianites, which have been buried less than 50 m, were carefully wrapped and impregnated with epoxy in the laboratory. Porosities and intergranular volumes were measured by point counting polished thin sections under reflected light. The accuracy of this method was tested by point counting polished sections made from artificially packed sands of known porosity. The average depositional porosity of 18 samples of dune sand is 33.9%. This is identical to the average intergranular volume of 34.3% for 25 Tertiary eolianites, and well within point counting errors. Sorting appears to be the dominant factor in controlling depositional porosity of the dune sands. The average depositional porosity for samples of ripple stratification is 32.7%, while that for grain-fall or grain-flow stratification is 36.5%. Why the depositional porosity of Namib sands and sandstones is 10-15% lower than that obtained by other workers for similar sediments is not clear.