Abstract: In this study, Unified Power Quality Conditioner (UPQC) is designed and simulated by synchronous reference frame theory. The proposed system is comprised of series and shunt inverters which can compensate the sag, swell and unbalance voltage, harmonics and also the reactive power. PI controller is used to stabilize DC link voltage and balance the active power between the shunt and series inverters. The capacity of series and shunt inverters is calculated through loading calculations of these inverters applying phasor diagram to increase the design accuracy. The results of simulation in MATLAB/SIMULINK software show that the system compensates current and voltage distortion correctly.