  Single-photon detectors are ubiquitous in quantum information science and
quantum sensing. They are key enabling technologies for numerous scientific
discoveries and fundamental tests of quantum optics. Photon-number-revolving
detectors are the ultimate measurement tool of light. However, few detectors to
date can provide high-fidelity photon number resolution at few-photon levels.
Here, we demonstrate an on-chip detector that can resolve up to 100 photons by
spatiotemporally multiplexing an array of superconducting nanowires along a
single waveguide. The unparalleled photon number resolution paired with the
high-speed response exclusively allows us to unveil the quantum photon
statistics of a true thermal light source for the first time, which is realized
by direct measurement of high-order correlation function g^(N) with N up to 15,
observation of photon-subtraction-induced photon number enhancement, and
quantum-limited state discrimination against a coherent light source. Our
detector provides a viable route towards various important applications,
including photonic quantum computation and quantum metrology.
