<p>The Power quality of the electrical system is an important issue for industrial, commercial, and housing uses. An increasing request for high quality electrical power and an increasing number of distorting loads had led to increase the consideration of power quality by customers and utilities. The development and use of flexible alternating current transmission system (FACTs) controllers in power transmission systems had led to many applications of these controllers. A unified power flow controller (UPFC) is one of the FACTs elements which is used to control both active and reactive power flow of the transmission line. This paper tried to improve power quality using a fuzzy logic controller (FLC) based UPFC, where it used to control both active and reactive power flow, decreas the total harmonic distortion (THD), correct power factor, regulate line voltage and enhance transient stability. A comparison study of the performance between the system with a conventional PID controller and FLC has been done. The theoretical analysis has been proved by implementing the system using MATLAB/SIMULINK package.The Power quality of the electrical system is an important issue for industrial, commercial, and housing uses. An increasing request for high quality electrical power and an increasing number of distorting loads had led to increase the consideration of power quality by customers and utilities. The development and use of flexible alternating current transmission system (FACTs) controllers in power transmission systems had led to many applications of these controllers. A unified power flow controller (UPFC) is one of the FACTs elements which is used to control both active and reactive power flow of the transmission line. This paper tried to improve power quality using a fuzzy logic controller (FLC) based UPFC, where it used to control both active and reactive power flow, decreas the total harmonic distortion (THD), correct power factor, regulate line voltage and enhance transient stability. A comparison study of the performance between the system with a conventional PID controller and FLC has been done. The theoretical analysis has been proved by implementing the system using MATLAB/SIMULINK package.</p>