Using a hybrid approach that incorporates both particle swarm optimization (PSO) and gravitational search algorithms (GSA), this project aims to find the best way for power systems to distribute their energy. A novel heuristic search optimization technique, the GSA is works on the law of gravity. While this strategy has many advantages, it suffers from sluggish search performance and memory constraints. In order to discover a solution to this problem, the PSO technique was utilized. PSO and GSA, were utilized in this investigation to discover the optimal power flow utilizing a combination of these two methodologies. The suggested optimization method merges the social thinking and local search features of particle swarm optimization with those of the GSA, therefore taking benefit of both algorithms. This study examines and evaluates an optimization technique for the optimal power flow problem, focusing on reducing fuel costs, improving the voltage profile, and minimizing real power losses. The investigation and assessment are conducted on the commonly used IEEE 30-bus test systems. The simulation findings showcase the robust and effective resolution of the optimum power transfer problem through the amalgamation of Particle Swarm Optimization (PSO) and Gravitational Search Algorithm (GSA).