Electrocoagulation is an attractive method for the many types of water and wastewaters treatments due to its advantages such as environmental friendliness, cost effectiveness, energy and high removal efficiency. The goal of this study was to investigate the COD removal rate and energy efficiency of COD parameter from real textile wastewater by solar energy assisted electrocoagulation process using aluminium and iron electrodes. In addition, process optimisation was performed by Monte Carlo Simulation and the relationship between the parameters was investigated by sensitivity analysis. At optimum reaction parameters, COD removal percentage reached 97.51% at aluminium electrode, while the highest removal percentage was 78.70% at iron electrode. The minimum energy consumption and cost for Al and Fe electrode were 1.2 kWh/m3 and 0.144 $/m3, respectively.