The injected grid current of single-phase grid-connected inverter will be distorted when the grid voltage contain any low-order harmonics. Thus, an effective harmonic suppression method should be designed to reduce total harmonic distortion for injected grid current, a novel method of harmonic suppression is proposed to achieve a low THD. In this paper. Harmonic components of grid voltage is extracted by the fourth order band-pass filter separately and injected into the reference of inverter output voltage for compensation. The particle swarm optimization is used to optimize the parameters of double loop control and the fourth order band-pass filter for a better effect of harmonic suppression. Simulation and experimental results validate the feasibility of the proposed method.