In this paper is to study the denomination Power quality and large refers to maintaining a proximal sinusoidal power distribution bus voltage at rated magnitude and frequency. This is mainly affected by the generation of harmonics. Even though electronic and non-linear devices are flexible, economical and energy efficient, they may degrade power quality by creating harmonic currents and consuming excessive reactive power. This paper shows the method of improving the power quality using shunt active power filter with proposed optimized PI. The proposed topic comprises of PI controller, filter hysteresis current control loop, dc link capacitor. The switching signal generation for filter is from hysteresis current controller techniques. With the all these element shunt active power filter reduce the total harmonic distortion. Its source current, compensating current and THD values are studied, then PI control strategy is applied then the differences in THD are compared. The PI feedback compensation design starts with the small signal system's transfer function. Then an optimum constant of PI for a Shunt-APF is proposed and implemented to enhance its response to compensation of harmonics of linear and non-linear loads. The obtained results have demonstrated the ability to compensate the current harmonics effectively under distorted source conditions. The fluctuation in the dc bus voltage of the filter depends on the compensation speed of the outer loop that regulates the dc bus voltage. harmonics. The model is made in MATLAB / SIMULINK and successfully reduces the harmonic in the source current.