Optimal Power Flow (OPF) is one of the most effective tools for both analysis of current and planning of new power systems. The Manuscript is about an Artificial Intellicence (AI) application based on Heuristic methods can solve OPF problems with an more extreme accuracy compared to conventional methods. In this paper, the total hourly generation cost of generator units are minimized as an objective function to meet the load demand and system losses. Real Coded Genetic Algorithm (GA) and Particle Swarm Optimization (PSO) methods developed using MATLAB are applied to IEEE 14 and IEEE 30 standart test systems to solve OPF problem. In consequence of the OPF carried with the use of PSO and GA, the optimum solutions were compared to similar studies in the literature. It was determined that the PSO algorithm developed within the scope of this paper provides lower-cost results than GA developed for this study and the GA studies that are present in the literature.