The burning of corn straw will cause serious air pollution, and the utilization of corn straw can avoid the burning of corn straw and reduce environmental pollution. The pyrolysis of corn straw into biochar (BC) is a promising approach to apply corn straw in environmentally sustainable development. Dye wastewater such as methyl orange (MO) and methylene blue (MB) is a pollution that poses a threat to human health and the environment. Herein, biochar/TiO2 (BC/TiO2) and biochar/ZnO (BC/ZnO) were prepared by pyrolysis of corn straw for the photodegradation of MO and MB in water. The MO removal rates of BC/TiO2 and BC/ZnO are up to 83.3 % and 76.2 %, respectively, and the MB removal rates of BC/TiO2 and BC/ZnO are 78.6 % and 71.4 %, respectively. The photothermal effect of BC improves the surface temperature of photocatalysts and promotes the separation and transfer of photogenerated electron-hole pairs, enhancing the photodegradation of MO and MB efficiencies. Three-dimensional (3D) FDTD simulations were performed to investigate the mechanism of photothermal effect in BC/TiO2 and BC/ZnO. This work provides a promising approach to the utilization of corn straw.