To restore unavoidable capacity losses, we propose a method of mixing and online electrolysis that resolves the imbalance of electrolyte concentration, volume and valence simultaneously. The cycle life of all-vanadium redox flow batteries is effectively prolonged at various current densities (120, 180, 240 and 300 mA cm−2) using different Nafion membranes (Nafion 212, Nafion 115 and Nafion 117). Besides, the total vanadium concentrations of the electrolytes detected by the titrator indicates minimal influence of electrolysis on the batteries. Although the capacity recovery decreases over long-term cycles, especially at the higher current density, this decrease is mainly due to the attenuation of the electrochemical performance of the electrodes, as evidenced by cyclic voltammetry curves. In addition, we conduct long-term cycle tests of 4140 and 5100 cycles, and we observe capacity retentions of 89.87% and 81.39% on batteries with Nafion 115 and Nafion 117, respectively, at the current density of 120 mA cm−2. Based on these results, we speculate that the method of mixing and online electrolysis can operate over indefinite cycles. This low-cost, convenient method, which does not need replacement of electrolytes, is beneficial to prospective applications in large-scale energy storage.