Selective harmonic elimination (SHE) is a powerful modulation scheme aims to find the required switching angles in order to eliminate the number of undesired harmonics. SHE is a complicated problem which consists of several nonlinear equations which have multiple local minima. In order to eliminate the higher number of undesired harmonics and as a result reducing the total harmonic distortion (THD) much more efficiently, the degrees of freedom must be increased. This means that the number of switching angles gets more and as a result, the problem gets more intricate. As the number of switching angles increases, using either traditional iterative techniques or resultant theory method gets useless. So, in this paper, SHE is treated as an optimization problem where Teaching–Learning-Based Optimization algorithm (TLBO) is found as an efficient tool to solve it. The provided experimental and simulation results of a 7-level multi-level inverter validate the efficiency and practicability of the implemented scheme.