The bubble dynamic behaviors on the electrode surface are significantly affected by the magnetohydrodynamic (MHD) flow induced by the Lorentz force resulting from the applied magnetic field. However, the mechanism of the impact of a magnetic field perpendicular to the electrode on the dynamic behaviors of bubble remain unclear. In this study, the evolution law of a single oxygen bubble on the surface of a TiO2 photoelectrode under the influence of a vertical magnetic field with different magnetic induction intensities was investigated. The presence of a vertical magnetic field effectively promoted the rapid detachment of bubbles from the electrode surface and greatly improved the gas evolution efficiency. The mass transfer was dominated by single-phase free convection during bubble evolution. Under the influence of the vertical magnetic field, the mass transfer coefficient near the electrode was enhanced, and the adverse effects of bubbles on mass transfer were counteracted when they entered the reaction-controlled growth phase. The further multiphysics simulation found that the MHD convection decreased the local supersaturation of reaction product oxygen molecules near the electrode, thereby reducing concentration overpotential and increasing the reaction rate. This study provides an experimental and theoretical basis for promoting the bubble detachment and the reaction rate on the gas evolving electrode surface during photoelectrochemical water splitting.