With the application of large scale nonlinear load in power systems, lots of harmonic are produced, causing the total power factor to decrease. Therefore, it needs to compensate the reactive power of power systems. The disadvantages of the widely applied static var compensator are that the size of the compensator is too large, and the control ability is poor when the capacity of power systems is small. So a reactive power generator based on voltage source inverter is proposed in this paper. The reactive power generator takes series connection of IGBTs as the main circuit structure, the inverter as core and DSP as controller. The close loop framework consists of human-computer interaction, measurements and feedback control. The inverter is controlled by a digital PI close loop controller to feed a phase adjustable current to power systems to compensate reactive power. The system’s structure is simple, the control is flexible, and the size is small. The test results show that the response of this reactive power generator is quick, and it can compensate the power factor to be 1 which means that it has good effect of static reactive compensation.