This paper used an artificial jellyfish search (AJFS) optimizer suitable for selective harmonic elimination-based modulation for multilevel inverter (MLI) voltage control application. The main objective was to remove the undesired lower-order harmonics in the output voltage waveform of an MLI. This algorithm was motivated by the behavior of jellyfish in the ocean. Jellyfish have the ability to find the global best position where a large quantity of nutritious food is available. The paper applied AJFS algorithm on five, seven, and nine levels of CHB-MLI. The optimum switching angle was calculated for the entire modulation range for the desired lower-order harmonics elimination. The problem formulated to achieve the objective was solved in a MATLAB environment. The total harmonic distortion (THD) values of five-, seven-, and nine-level inverters for various modulation indexes were computed using AJFS and compared with the powerful differential evolution (DE) algorithm. The comparison of THD results clearly demonstrated superior THD in the output of CHB-MLI of the AJFS algorithm over DE and GA algorithm for low and medium values of modulation index. The experimental results further validated the better performance of the AJFS algorithm.