Abstract For the need of Active Power Filter(APF) in engineering applications, the article describes and analyzes a improved ip-iq method on harmonic current detection, the improved ip-iq method can not only applies to single-phase, three-phase three-wire and three-phase four-wire systems, but also for unbalanced three phase system. The algorithm improved the extraction process of the positive sequence voltage as well as the part of vector transform, to avoid the error when the grid voltage asymmetry, reduce the amount of engineering calculations, and improve the accuracy. In addition, the algorithm is applied to the Active Power Filter, by using Matlab/Simulink. The simulation results improved that the Active Power Filter using improved method can quickly and accurately compensate for the power grid. We can verify the effectiveness of the proposed algorithm.