  We perform spatially-resolved, pixel-by-pixel SED fitting on galaxies up to
$z\sim2.5$ in the Hubble Extreme Deep Field (XDF). Comparing stellar mass
estimates from spatially resolved and spatially unresolved photometry we find
that unresolved masses can be systematically underestimated by factors of up to
5. The ratio of the unresolved to resolved mass measurement depends on the
galaxy's specific star formation rate (sSFR): at low sSFRs the bias is small,
but above sSFR$\ \sim 10^{-9.5}$ yr$^{-1}$ the discrepancy increases rapidly
such that galaxies with sSFRs$\ \sim 10^{-8}$ yr$^{-1}$ have unresolved mass
estimates of only one half to one fifth of the resolved value. This result
indicates that stellar masses estimated from spatially-unresolved datasets need
to be systematically corrected, in some cases by large amounts, and we provide
an analytic prescription for applying this correction. We show that correcting
stellar mass measurements for this bias changes the normalization and slope of
the star-forming main sequence and reduces its intrinsic width; most
dramatically, correcting for the mass bias increases the stellar mass density
of the Universe at high redshift and can resolve the long-standing discrepancy
between the directly-measured cosmic star formation rate density at $z\gtrsim1$
and that inferred from stellar mass densities ("the missing mass problem").
