Rainwater collected in the Toluca region of Mexico with a pH of 6.25 was treated with an electrochemical process, and the efficiency of two supporting electrolytes were compared, one food grade (sea salt) and the other reagent grade (sodium sulfate). In the first stage, rainwater was characterized to detect the COD content, turbidity, metals such as zinc, iron, aluminum, and lead. Electrocoagulation treatment was performed with an electrochemical cell using aluminum electrodes to study the effect on COD and turbidity, as well as the removal of heavy metals present. The results obtained with response surface methodology and a central composite design reveal that the optimal conditions of the electrocoagulation treatment were a current density of 3.26 mA/cm2 and a time of 11.38 min. Using sodium sulfate, the percentage of turbidity removal is 99.27% and COD 70.83%. The use of sea salt as a support electrolyte in these conditions allowed the removal of COD at 100%, turbidity at 100%, and Al 100%, Mn 84.29%, Zn 97.97%, Pb 46%, Fe 21%. Energy costs that are low lead to proven savings when using this system, indicating that this treatment is an option to both improve rainwater conditions and be able to make use of it safely.