One of the most significant issues that people throughout the world will confront in the future years is a lack of clean and safe water. Anthropogenic activities, in particular, are polluting water systems. With rising population, urbanization, and climate change, water reuse has become a requirement in some areas of the globe, putting pressure on the development of effective water treatment methods for a range of contaminants. High biological oxygen demand (BOD), chemical oxygen demand (COD), oil-grease, and other pollutant loads define dairy sector effluent. Improved technology is required to address these issues. Electrocoagulation is a new type of therapy. It’s simple to use, ecologically friendly, and removes a wide range of contaminants from a variety of water types. The goal of this study was to see how operational factors such applied voltage, number of electrodes, distance between electrodes, electrode shape, and reaction time affected the electrocoagulation of actual dairy effluent. Aluminum and iron electrodes are used for this purpose. It was discovered that raising the applied voltage, reaction time, and decreasing the distance between electrodes improved COD, BOD, EC, TDS, color, and oil-grease removal efficiency. Moreover, switch between square, triangular electrodes and perforated cylindrical. The data show that electrocoagulation is effective at the maximum COD, BOD removal efficiency of first electrode at 20 holes of cylindrical shape is (88.03) %, (87.97) %, respectively. Second triangle shape is (100) %, (100) % respectively. Third square shape is (99.38) %, (99.42) % respectively. the maximum removal of TDS, EC efficiency of first electrode at 20 holes of cylindrical shape is (67.57) %, (62.34) %, respectively. Second triangle shape is (77.45) %, (67.68) % respectively. Third square shape is (81.96) %, (71.25) % respectively. The maximum color and oil-grease removal efficiency of first electrode at 20 holes of cylindrical shape is (100) %, (100) %, respectively. Second triangle shape is (100) %, (100) % respectively. Third square shape is (100) %, (100) % respectively. Electrocoagulation methods for the treatment of dairy wastewaters were shown to be successful in the research. Finally, the findings indicated that electrocoagulation is a technically feasible method for removing contaminants from dairy wastewaters.