The power conversion efficiency (PCE) of perovskite solar cells (PSCs) can be improved through the concurrent strategies of enhancing charge transfer and passivating defects. Graphite carbon nitride (g-C3N4) has been demonstrated as a promising modifier for optimizing energy level alignment and reducing defect density in PSCs. However, its preparation process can be complicated. A simple one-step calcination approach was used in this study to prepare g-C3N4-modified TiO2 via the incorporation of urea into the TiO2 precursor. This modification simultaneously tunes the energy level alignment and passivates interface defects. The comprehensive research confirms that the addition of moderate amounts of g-C3N4 to TiO2 results in an ideal alignment of energy levels with perovskite, thereby enhancing the ability to separate and transfer charges. Additionally, the g-C3N4-modified perovskite films exhibit an increase in grain size and crystallinity, which reduces intrinsic defects density and extends charge recombination time. Therefore, the g-C3N4-modified PSC achieves a champion PCE of 20.00%, higher than that of the control PSC (17.15%). Our study provides a systematic comprehension of the interfacial engineering strategy and offers new insights into the development of high-performance PSCs.