The invention discloses a linear analog counting circuit based on capacitor discharging. The circuit is constituted by a counting capacitor C and eight NMOS tubes. The eight NMOS tubes comprise an MN0, an MN1, an MN2, an MN3, an MN4, an MN5, an MN6, and an MN7. The MN0 is a signal input switch, and the MN1, the MN2, the MN3, and the MN4 are used to form an improved Wilson current mirror. The MN5 is a reset switch, and an MOS tube MN 6 and an MOS tube MN7 are used to form a voltage following circuit, which is used as the output stage of the circuit, and the output stage of the circuit is used to output the final counting results of the counting capacitor. The counting circuit has advantages of small circuit area, high filling coefficient, high linearity, large counting range, and applicability in counting of number of photons of high-density, full-integration, and low-cost SPAD array detector.