Two-dimensional (2D) Nb-based oxynitrides are promising visible-light-responsive photocatalysts for the water splitting reaction, but their photocatalytic activity is degraded by the formation of reduced Nb5+ species and O2- vacancies. To understand the influence of nitridation on the formation of crystal defects, this study synthesized a series of Nb-based oxynitrides through the nitridation of LaKNaNb1-xTaxO5 (x = 0, 0.2, 0.4, 0.6, 0.8, 1.0). During nitridation, K and Na species volatilized, which helped transform the exterior of LaKNaNb1-xTaxO5 into a lattice-matched oxynitride shell. Ta inhibited defect formation, yielding Nb-based oxynitrides with a tunable bandgap between 1.77 and 2.12 eV, straddling the H-2 and O-2 evolution potentials. After loading with Rh and CoOx cocatalysts, these oxynitrides exhibited good photocatalytic activity for H-2 and O-2 evolution in visible light (650-750 nm). The nitrided LaKNaTaO5 and LaKNaNb0.8Ta0.2O5 delivered the maximum H-2 (19.37 mu mol h(-1)) and O-2 (22.81 mu mol h(-1)) evolution rates, respectively. This work provides a strategy for preparing oxynitrides with low defect densities and demonstrates the promising performance of Nb-based oxynitrides for water splitting.