Like other developing countries, Morocco has undergone a real industrial revolution that generates a huge amount of colored wastewater. Methylene blue (MB) could be considered as commonly model of cationic dyes that are widely used in industries. In the present work, the removal of MB was investigated in the presence of NaCl as electrolyte by electrocoagulation (EC) process. Parameters studied are the nature of electrodes, electrode spacing, initial dye concentration, agitation speed, applied current density, NaCl concentration, and the effect of the initial pH. Stainless steel electrodes have been used as cathode and anode in the electrochemical cell. The performance of the process was evaluated in terms of color removal, chemical oxygen demand (COD), total organic carbon (TOC), electrical power consumption, current efficiency, and the quantity of sludge formed. The results showed that the removal percent of 20 mg/L MB is 100 %, using stainless steel electrodes with an interspace of 1.5 cm and 20 mA/cm² for 6 min in the presence of 0.1 M NaCl at natural pH. COD and TOC removals within 15 min were 45% and 51% respectively. The power consumption, in that case, was 5.84 KWh/m3, while the amount of sludge formed was 1.64 Kg/m3.