This study proposes the use of stochastic evolutionary algorithms, specifically Particle Swarm Optimization (PSO) and Differential Evolution (DE), for optimizing the design of an extra high voltage 400/ √ 3 kV, 50 MVAr, 60 Hz core type shunt reactor. The goal is to minimize material costs and consider the evaluated loss cost to maximize efficiency while meeting relevant specifications and regulations. All key optimization variables are considered, including the number of turns, the diameter and number of core magnetic packages, the length of air gaps, and the cross-sectional area of the coil conductor. The main calculation formulas are described, and a Python program is developed using PSO and DE algorithms. The results show a total ownership cost (TOC) reduction of 3.34% 1 and 5.55% using PSO and DE respectively, compared to the actual design built and tested in the laboratory by a national manufacturer, which was designed using trial and error method. Finally, the program is evaluated by performing different designs based on the evaluated cost of losses (USD/kW). It is concluded that the application of PSO and DE algorithms in shunt reactor design offers promising results, yielding more efficient solutions in terms of cost and time, ensuring compliance with current standards, and providing flexibility to optimize the design considering the specific efficiency requirements of the electrical grid based on the evaluated cost of losses.