This research deals with digital simulation of 14-bus power system using UPFC to improve the power quality. The UPFC is also capable of improving transient stability in a power system. It is the most complex power electronic system for controlling the power flow in an electrical power system. The real and reactive powers can be easily controlled in a power system using a UPFC system. The circuit model for UPFC is developed using rectifier and inverter circuits. The control angle is varied to vary the real and reactive powers at the receiving end. The Matlab simulation results are presented to validate the model.