Multilevel inverter has appeared as one of the important topologies in the area of high power and medium voltage because it can efficiently realize lower harmonics with reduced switching frequency. These Multilevel inverters (MLI) improve the energy quality shaped by producing many voltage levels. However, improving the quality of the output voltage of a multilevel inverter requires many switches, which tend to weigh down the structure and make it complex to control. This work deals with a comparison in terms of the spectral content of two configurations of thirty-one-level inverters for injection into the electrical grid. The first configuration is a classical cascaded H-bridge and the second one is a reconfigured Packed U-Cell (PUC) multilevel inverter. The classical configuration requires sixteen switches while the second uses only ten ones. The control technique based on the half-height modulation was performed and the Total Harmonic Distortion (THD) is calculated for each topology. For the PUC, we got a THD equal to 2.61% while we got 2.72% for the cascaded H-bridge. These results obtained in the MATLAB/Simulink environment, show that the reconfigured structure of the PUC inverter is a good candidate for injection into the electrical network.