This paper discusses a method for balancing the voltages of DC capacitors in a cascaded H-bridge inverter used for power line conditioning. It presents an algorithm that adjusts capacitor charging and discharging based on output pulse widths to achieve equal voltage distribution and improve power quality. MATLAB/Simulink simulations demonstrate the effectiveness of the proposed voltage balancing technique.