Using residual copper metal from waste circuit boards, ordered carbon materials containing copper (PCBs-Cu-800) were synthesized by self-doping for the electrocatalytic degradation of ofloxacin (OFL). Although PCBs-Cu-800 has a smaller specific surface area, its efficiency in degrading OFL was higher than that of carbon materials without copper (PCBs-800), reaching 95.9 % within 2 h. The PCBs-Cu-800 electrode can generate a large amount of H2O2 in the initial stage of degradation, thereby increasing the amount of hydroxyl radicals (·OH) generated and removing OFL. Density functional theory simulations were used to calculate the adsorption energies of O2 on both materials, demonstrating that the self-doped copper model was more prone to O2 adsorption, and elucidating the excellent electrocatalytic performance of PCBs-Cu. The residual copper metal in the raw material is important in the electrocatalytic processes. This study presents an environmentally friendly catalytic material capable of effectively degrading OFL in solution using waste circuit boards and further expands the application scope of advanced electrochemical oxidation technology in wastewater treatment.