Shunt capacitors can effectively improve the system voltage level and increase the economy of grid operation. However, under the effect of harmonics, the capacitor bank is prone to harmonic resonance, which causes overcurrent and overvoltage and threatens the safe operation of the capacitor itself and the system. To avoid damage to capacitors due to harmonics, the harmonic current variation characteristics of shunt capacitors are investigated. Based on the established mathematical model of shunt capacitors, the characteristics of harmonic current amplification under different harmonic states are analyzed. Based on the amplification characteristics and sampling law, the harmonic current signal is acquired using the full-phase fast Fourier transform algorithm. The full-phase fast Fourier transform algorithm is improved by the phase difference algorithm to complete harmonic current detection. The experiments show that the dynamic response time is 1.6 cycles with minimum steady-state error before and after the load current jump. When the capacitor changes from unit power factor to 0.89 inductance, the harmonic current at point A changes from 17.59A to 21.34A and 11.65 to 22.38A, respectively. The deviation values are 3.75A and 10.73A, respectively. It shows that the algorithm has good tracking ability for load currents and can effectively detect the harmonic currents of shunt capacitors and obtain accurate variation characteristics. It can ensure that the harmonic content of the shunt capacitor in the distribution system is relatively reasonable, and realize the safe, stable and economic operation of the equipment.