This paper addresses the problem of optimal pulse width modulation (PWM) voltage switching signals that minimizes the total harmonic distortion (THD) for a three-level inverter. Previous works have focused on the derivation of ad-hoc methods that achieve low voltage THD values by using frequency domain analysis and brute-force search. The use of optimization techniques in power systems, especially in THD minimization, can improve system performance and reduce computational complexity, thus providing a manageable method with claims to optimality. In this paper, an optimization method, the Lagrange multipliers technique, is used to solve the THD minimization problem. For a given modulation index it is shown that the minimization of the voltage THD results in a single-switch solution. Finally, the performance of the proposed optimal singleswitch solution is examined in simulations. The proposed method reduces computational complexity, compared to the brute-force methods, and increases solution accuracy by using analytical THD time domain expressions.