In this study, the Ti/SnO2–RuO2 electrodes with different Yb contents were prepared by sol–gel method and thermal decomposition method, and the surface morphology and crystal structure of the electrodes were characterized by scanning electron microscopy (SEM), atomic force microscopy (AFM) and X-ray diffraction (XRD), the electrochemical properties of the electrodes were tested by linear sweep voltammetry (LSV) and cyclic voltammetry (CV). The electrochemical oxidation device was constructed with Yb-doped Ti/SnO2–RuO2 electrode as the anode and titanium plate as the cathode, and the electrochemical oxidation effect and product changes of the anode on coking wastewater were investigated. The results show that the surface of the electrode is flat with high crystallinity of SnO2 and RuO2 crystals at 1.5% Yb doping, and the LSV and CV curves indicate that the Yb doping of 1.5% increases the oxygen precipitation potential and electrocatalytic oxidation activity of the electrode. When the electrode with Yb doping of 1.5% is the anode with current density of 10 mA/cm2 electrochemical oxidation time of 30 min, the electrode can remove chemical oxygen demand (COD) up to 85.06%, total organic carbon (TOC) up to 60.59% and UV254 from 1.594 to 0.507 for coking wastewater. Gas chromatography (GC–MS), UV–vis and three-dimensional fluorescence results of coking wastewater before and after treatment show that large toxic substances in coking wastewater are degraded to low toxic organic substances, and most soluble organic substances are degraded and transformed. This study provides the possibility of basic research for the engineering practice of electrochemical oxidation for the treatment of coking wastewater.