In this paper, a multilevel inverters’ output voltage THD is the object of optimizationdu. Since the higher number of voltage levels in output of a multilevel leads to high quality output voltage and current, it is desired to have more levels in output, and it needs more switches to handle this issue. As the number of equations increase, it becomes complicated to find optimum switching angles that lead to least THD value, So particle swarm optimization method is used to find optimum switching angles in this paper. Lower THD will improve the power quality of output voltage, and it can be achieved by selected harmonic elimination method, that has been used to eliminate desired harmonics. The topology used in this paper is an optimized topology of multilevel inverter, cascaded H-bridge with unequal DC voltage sources. The novelty of this work is in its very low output THD and the optimized configuration calculations of the presented cascaded multilevel inverter.