We use spectral stacking to measure the contribution of galaxies of different masses and in different hierarchies to the cosmic atomic hydrogen (HI) mass density in the local Universe. Our sample includes 1793 galaxies at z < 0.11 observed with the Westerbork Synthesis Radio Telescope, for which Sloan Digital Sky Survey spectroscopy and hierarchy information are also available. We find a cosmic HI mass density of Ω HI = (3.99 ± 0.54) × 10 −4 h −1 70 at z = 0.065. For the central and satellite galaxies, we obtain Ω HI of (3.51 ± 0.49) × 10 −4 h −1 70 and (0.90 ± 0.16) × 10 −4 h −1 70 , respectively. We show that galaxies above and below stellar masses of ∼10 9.3 M ⊙ contribute in roughly equal measure to the global value of Ω HI . While consistent with estimates based on targeted HI surveys, our results are in tension with previous theoretical work. We show that these differences are, at least partly, due to the empirical recipe used to set the partition between atomic and molecular hydrogen in semi-analytical models. Moreover, comparing our measurements with the cosmological semi-analytic models of galaxy formation S and GALFORM reveals gradual stripping of gas via ram pressure works better to fully reproduce the properties of satellite galaxies in our sample, than strangulation. Our findings highlight the power of this approach in constraining theoretical models, and confirm the non-negligible contribution of massive galaxies to the HI mass budget of the local Universe.At the same time, studies of the HI gas content of galax-