This work aims to obtain the switching angles to reduce the total harmonic distortion (THD) and compare the different sets of angles obtained by modifying the modular index (Mi) in a seven-level multilevel inverter using the differential evolution (DE) algorithm. A seven-level cascaded multilevel inverter with RL load was simulated in MATLAB Simulink. The Mi was varied (0.6 to 1.27) to check which set of switching angles is optimal to reduce the THD. These sets of angles are then experimentally validated on a test bench. A brief discussion of the results is presented, comparing the minimum THD found without considering Mi, versus the minimum THD obtained if Mi is less than 1.