Switching power supply is widely used in industrial equipment, household appliances, and other fields due to the advantages of high integration and lightweight. Voltage sags can seriously affect the output voltage of switching power supply and the working condition of its power supply equipment; at the same time, the working scenarios of power equipment using switching power supply often have different level of harmonic problems. Considering the continuous innovation of switching power supply technology, the previous analysis and test results on the effect of voltage sags and harmonics on switching power supplies may no longer be applicable. The paper reveals the mechanism of the effect of harmonic alone as well as voltage sag superimposed harmonics on the output voltage of the switching power supply. Then the test research program was developed, and four different brands switching power supplies were selected for the test research, with which the effects of different amplitude voltage sags, harmonics with different frequencies and distortion, as well as voltage sag superimposed harmonics on the output voltage of switching power supplies were investigated. The results show that the tolerance ability of switching power supplies to voltage sags has been improved compared with previous switching power supplies, and the harmonic itself has less effect on the output voltage of switching power supply, but the joint action of harmonics and voltage sags will have a greater effect on the output voltage of switching power supply. © 2024 Institute of Electrical Engineers of Japan and Wiley Periodicals LLC.