This article introduces a novel approach called randomized carrier-based discontinuous pulse width modulation (RCDPWM) to address the challenge of mitigating both low-order and high-order harmonics concentrated at the switching frequency and its integer multiples in the output voltage and current of a three-level inverter. The proposed strategy reduces switching losses and a wide dispersion of voltage and current harmonics with significantly smaller amplitudes by integrating features from discontinuous and randomized PWM methods. This characteristic proves beneficial for enhancing efficiency and electromagnetic compatibility. The RCDPWM strategy involves three schemes: two simple schemes (one random parameter), randomized pulse position modulation (RPP-DPWM) and randomized carrier frequency modulation (RCF-DPWM), and a dual scheme combining the two previous ones (RPPRCF-DPWM). Power spectral density (PSD) is used to assess the effectiveness of the proposed strategy in quantitatively analyzing the harmonic dispersion degree. The results demonstrate that the proposed RCDPWM strategy significantly expands harmonic clusters around the switching frequency, reducing its intensity. The spectrum analysis revealed that the RPPRCF-DPWM scheme is the most effective in spreading the output voltage and current spectrum compared to simple schemes (RPP-DPWM and RCF-DPWM).