This document proposes a variable switching cycle SPWM technique for reducing switching losses in grid-connected inverters without increasing current harmonics. The technique determines the optimal switching cycle in each half of the fundamental period to spread the noise spectrum and minimize switching losses under the constraint of maintaining the same current THD as a constant switching cycle method. Simulation results validate that the proposed technique reduces switching losses compared to total demand distortion and constant ripple techniques.