  We present a new approach to infer the surface density of magnetic moments
$I_s$ in ultrathin ferromagnetic films with perpendicular anisotropy. It relies
on quantitative stray field measurements with an atomic-size magnetometer based
on the nitrogen-vacancy center in diamond. The method is applied to
microstructures patterned in a 1-nm-thick film of CoFeB. We report measurements
of $I_s$ with a few percent uncertainty and a spatial resolution in the range
of $(100$ nm)$^2$, an improvement by several orders of magnitude over existing
methods. As an example of application, we measure the modifications of $I_s$
induced by local irradiation with He$^+$ ions in an ultrathin ferromagnetic
wire. This method offers a new route to study variations of magnetic properties
at the nanoscale.
