Modeling is an indispensable tool for a better wastewater treatment strategy. However, the modelling of slaughterhouse wastewater treatment by electrocoagulation can be difficult to achieve because of the various physico-chemical mechanisms involved. It is in this context that the objective of this study was to model and optimize COD removal and electrical energy consumption by response surface methodology (RSM) during the treatment of slaughterhouse wastewater by electrocoagulation (EC). For this purpose, a full factorial design (FD) was first used to observe the effect of experimental parameters (stirring speed, pH, time and current intensity) on COD removal and energy consumption. Then, a central composite design (CCD) was performed to optimize COD removal and electrical energy consumption. The optimum conditions are obtained at the stirring speed of 871 rpm, pH = 6.83; time of 80 min and current intensity of 1.85 A. By applying these optimal conditions for the treatment, reductions of 84 ± 1.08% of COD; 93.86 ± 0.91% of BOD; 97.80 ± 0.86% of turbidity and 99.62 ± 0.12% of PO 4 3and an energy consumption of 9 KWh.m -3 were obtained. Thus, this study reveals that RSM is an effective tool for the modeling and optimization of electrocoagulation.