The use of multilevel inverters in renewable energy such as fuel cell, solar cell, and wind turbines, which use converters, is becoming more prominent. Therefore, the harmonic reduction concept in these inverters is being considered. In this paper, three algorithms (particle swarm optimization (PSO), modified particle swarm optimization (MPSO), and weight improved particle swarm optimization (WIPSO)) are used to determine the optimum switching angles of cascade multilevel inverters for obtaining minimum voltage total harmonic distortion (THD) in a wide range of modulation index. To reduce the THD, selective harmonics should be eliminated by optimal switching angles. In this paper, five switching angles of an Eleven-Level H-bridge inverter are determined by the three mentioned algorithms to reduce the voltage THD. The derived equations for the computation of output voltage THD of an inverter are used as the objective function. This objective function is used to minimize the THD in the output voltage of an inverter. While minimizing the objective function, the selective harmonics such as the 5th, 7th, 11th and 13th can be controlled by using the PSO, MPSO, and WIPSO algorithms. The simulations are performed for an 11 level cascaded multilevel inverter to show the validity of the proposed methods. The results show that all three proposed algorithms can eliminate selective harmonic in optimization problem and output voltage THD decreases. Generally, the WIPSO algorithm finds the answer with less iteration and with higher speed convergence among the proposed methods. The performance of the three mentioned algorithms for THD reduction depends on amplitude modulation index (M). MPSO and WIPSO algorithms have lower iteration numbers than PSO algorithm. Also WIPSO algorithm has higher speed convergence among the proposed methods. All three proposed algorithms reduce the 5th, 7th, 11th and 13th order harmonics in optimization problem.