Recently, the visible or even-to-near-infrared light absorbing perovskite ABO 3 solid state solutions, show promising application in solar cells and multienergy harvesters or sensors by simultaneously introducing transition metal and oxygen vacancies. However, the existence of oxygen vacancies fundamentally causes photoexcited carrier trapping and large leakage current. Therefore, it is still challenging to limit oxygen vacancies while maintaining low bandgap and high ferroelectricity. Here, an efficient charge compensation strategy by finely adjusting the ion ratio on the A-site to obtain an oxygen-vacancy-free relaxer ferroelectric is demonstrated in the system of Na x Bi y TiO 3 -BaTi 0.5 Ni 0.5 O 3 , where y > x. It is found that the oxygen-vacancyfree composition still yields strong visible-near-infrared-light-absorbing and enhanced photoresponse, in which the photocurrent density doubles from ≈0.16 to ≈0.32 μA cm −2 . A new bandgap tuning mechanism is proposed according to the local structural information of Ni ions obtained via extended X-ray absorption fine structure. Moreover, this work succeeds in establishing the relationship between the concentration of oxygen vacancies and ferroelectric/piezoelectric properties of Na x Bi y TiO 3 -BaTi 0.5 Ni 0.5 O 3 . This research points out a promising route to the material design of bandgap engineered ferroelectrics with controlled defects, which is expected to benefit a wide range of functional energy conversion devices.