This paper deals with the application and optimization of active loops to mitigate the magnetic field generated by medium voltage/low voltage (MV/LV) substations. In particular, two active loops configurations are analyzed in several regions located around and above a particular MV/LV substation. An optimization process, based on a genetic algorithm, is applied in order to reduce the average magnetic field inside each region to the minimum, obtaining the optimum geometry of the loops and the currents to be injected. The performance of the proposed active loops is compared, highlighting their main advantages and disadvantages regarding its application to MV/LV substations.