In this paper, power system loss minimization using UPFC placed at optimal location given by Gravitational Search Algorithm is proposed. Here, the Gravitational Search Algorithm (GSA) optimizes the location of the UPFC, while the generator outage occurs. The generator outage affects the power flow constraints like power loss, voltage magnitude, real and reactive power flows. By connecting UPFC at the optimum location power flows are improved, which causes reduction in power loss. The proposed method is implemented in the MATLAB/simulink platform. The performance of proposed method is evaluated by comparing power loss under different conditions i.e. normal condition, generator outage condition and after connecting UPFC at optimal location which is given ABC algorithm and GSA. The comparison results demonstrate the superiority of the proposed approach and confirm its potential to find optimal location of UPFC.