In this study, Chemical Oxygen Demand (COD) from a pharmaceutical wastewater (PhW) was reduced by several techniques such as electro-Fenton (EF), photo electro-Fenton (PEF) and activated sludge (AS) processes and the obtained data were compared with each other. The effects of several parameters such as pH, current density, H2O2/Fe2+ molar ratio, volume ratio of H2O2/PhW, reaction time and UVA light were studied on the COD reduction through the EF and PEF processes. The Box-Behnken Design (BBD) under Response Surface Methodology (RSM) was applied to design and then optimize these processes. The optimal conditions for 87% of COD removal through the EF process were at pH of 3.27, current density of 57 mA/cm2, H2O2/Fe2+ molar ratio of 3.5, volume ratio of H2O2/PhW of 1.34 ml/l and reaction time of 56.32 min while the optimal conditions for 91.6% of COD removal through PEF process were at pH of 3.5, current density of 57.5 mA/cm2, H2O2/Fe2+ molar ratio of 3.81, volume ratio of H2O2/PhW of 1.5 ml/l, reaction time of 10.12 min and 6 W UVA light while 77.70% of COD removal was obtained by the AS process with residence time of 1020 min. According to the kinetic study, the second order reaction (with high R2 data) could properly model the EF and PEF processes.