We present a new determination of the galaxy stellar-mass function (GSMF) over the redshift interval 0.25 ≤ z ≤ 3.75, derived from a combination of ground-based and Hubble Space Telescope (HST) imaging surveys. Based on a near-IR-selected galaxy sample selected over a raw survey area of 3 deg2 and spanning ≥4 dex in stellar mass, we fit the GSMF with both single and double Schechter functions, carefully accounting for Eddington bias to derive both observed and intrinsic parameter values. We find that a double Schechter function is a better fit to the GSMF at all redshifts, although the single and double Schechter function fits are statistically indistinguishable by z = 3.25. We find no evidence for significant evolution in M⋆, with the intrinsic value consistent with log10(M⋆/M⊙)=10.55±0.1 over the full redshift range. Overall, our determination of the GSMF is in good agreement with recent simulation results, although differences persist at the highest stellar masses. Splitting our sample according to location on the UVJ plane, we find that the star-forming GSMF can be adequately described by a single Schechter function over the full redshift range, and has not evolved significantly since z ≃ 2.5. In contrast, both the normalization and the functional form of the passive GSMF evolve dramatically with redshift, switching from a single to a double Schechter function at z ≤ 1.5. As a result, we find that while passive galaxies dominate the integrated stellar-mass density at z ≤ 0.75, they only contribute ≲10 per cent by z ≃ 3. Finally, we provide a simple parametrization that provides an accurate estimate of the GSMF, both observed and intrinsic, at any redshift within the range 0 ≤ z ≤ 4.