  Heralded single-photon sources (HSPS) intrinsically suffer from multiphoton
emission, leading to a trade-off between the source's quality and the heralding
rate. A solution to this problem is to use photon-number-resolving (PNR)
detectors to filter out the heralding events where more than one photon pair is
created. Here, we demonstrate the use of a high-efficiency PNR superconducting
nanowire single-photon detector (SNSPD) as a heralding detector for a HSPS. By
filtering out higher-order heralding detections, we can reduce the $g^{(2)}(0)$
of the heralded single photon by $(26.6 \pm 0.2)\,\%$, or alternatively, for a
fixed pump power, increasing the heralding rate by a factor of $1.363 \pm
0.004$ for a fixed $g^{(2)}(0)$. Additionally, we use the detector to directly
measure the photon-number distribution of a thermal mode and calculate the
unheralded $g^{(2)}(0)$. We show the possibility to perform $g^{(2)}(0)$
measurements with only one PNR detector, with the results in agreement with
those obtained by more common-place techniques which use multiple threshold
detectors. Our work shows that efficient PNR SNSPDs can significantly improve
the performance of HSPSs and can precisely characterize them, making these
detectors a useful tool for a wide range of optical quantum information
protocols.
