This paper proposes a novel online solution, i.e. Modified-Equilibrium Optimizer-Levenberg-Marquardt (M-EO-LM) algorithm, for the symmetric and asymmetric harmonic elimination pulse width modulation (HEPWM) methods of the modular multilevel cascaded converters. A detailed comparison of the proposed M-EO-LM algorithm with nine state-of-the-art algorithms is also presented for twenty-nine unimodal, multimodal and composite benchmark test functions. M-EO-LM has proven its effectiveness by outperforming these algorithms. EO algorithm is first introduced for the solution of HEPWM method. Its comparison with several state-of-the-art algorithms depicts its superiority; but it gets stuck in the local minima. Modified-EO (M-EO) solves the problem by enhancing its exploration ability, and is then attached to a rapid calculus-based LM method to form the novel M-EO-LM algorithm. M-EO-LM algorithm initiates the solution process by solving the HEPWM equations for nine angles (N = 9 and 0.78 ≤ M ≤ 6.86) offline in only two iterations, depicting its remarkable convergence ability. Solution angles are then divided into several groups, serving as the search space for the online M-EO-LM algorithm. A comparison between HEPWM and nearest level modulation methods based on the output voltage THD values is provided to report the maximum number of solvable HEPWM angles for a complete online solution. These angles (N = 8 and 0.78 ≤ M < 5.18) are then solved online using the M-EO-LM algorithm. Comparing the computational times of the proposed online algorithm with differential evolution-Newton Raphson algorithm proves the rapid solution behavior of the M-EO-LM algorithm, validated through the simulation and realtime experimental results.INDEX TERMS Harmonic elimination PWM, modular multilevel cascade converter, fundamental voltage control, harmonic control, equilibrium optimizer, Levenberg-Marquardt algorithm.