We use the catalogue of 4315 extragalactic H i 21-cm emission line detections from HIPASS to calculate the most accurate measurement of the H i mass function ( HIMF ) of galaxies to date . The completeness of the HIPASS sample is well characterised , which enables an accurate calculation of space densities . The HIMF is fitted with a Schechter function with parameters : \alpha = -1.37 \pm 0.03 \pm 0.05 , \log ( \mbox { $M ^ { * } _ { HI } $ } / \mbox { $ { M } _ { \odot } $ } ) = 9.80 \pm 0.03 \pm 0.03 h% ^ { -2 } _ { 75 } , and \mbox { $ \theta ^ { * } $ } = ( 6.0 \pm 0.8 \pm 0.6 ) \times 10 ^ { -3 } h ^ { 3 } _ { 75 } { Mpc } ^ { % -3 } ( random and systematic uncertainties at 68 % CL ) , in good agreement with calculations based on the HIPASS Bright Galaxy Catalogue , which is a complete , but smaller , sub-sample of galaxies . The cosmological mass density of H i in the local universe is found to be \Omega _ { HI } = ( 3.5 \pm 0.4 \pm 0.4 ) \times 10 ^ { -4 } h _ { 75 } ^ { -1 } . This large homogeneous sample allows us to test whether the shape of the HIMF depends on local galaxy density . We find tentative evidence for environmental effects in the sense that the HIMF becomes steeper toward higher density regions , ranging from \alpha \approx - 1.2 in the lowest density environments to \alpha \approx - 1.5 in the highest density environments probed by this blind H i survey . This effect appears stronger when densities are measured on larger scales .