Based on first-principles calculations, a novel photocatalyst, Ta-doped and (Ta, N)-codoped BaTiO3, was designed and studied to water splitting using under visible light irradiation to produce hydrogen and oxygen. We have systematically investigated the geometrical structure and electronic structure of BaTiO3 by introducing dopants (Ta and (Ta, N)-pair) for visible-light driven photocatalyst. Our calculated result shows that the doped Ta atom may change conductivity of the pure BaTiO3 from p-type to n-type, but is hard to lead to the narrowing of the band gap. The reduction of band gap can be achieved by codoping with Ta and N atoms, indicating that Ta and N atoms play an important role on enhanced absorption in the visible light region. We predicted that (Ta, N)-codoped BaTiO3 could be a potential candidate as photocatalyst in solar-energy harvesting with improved efficiency. Meanwhile, our research can provide a theoretical guidance for the perovskite photocatalyst.