Water-splitting photocatalysts with good energy efficiency are highly desirable, among which metal-free graphitic carbon nitride (g-C3 N4 ) is considered to be very promising and has been intensively studied in recent years. However, its practical application is hindered by the relatively low efficiencies of visible-light absorption and electron-hole separation. Herein, based on first-principles calculations, it is predicted that, by forming nanocomposites with another carbon nitride (C2 N), the energy efficiency of g-C3 N4 can be significantly improved. On one hand, C2 N has a wide, strong optical absorption in the visible-light region, which acts as a photosensitizer and enhances the photoabsorption efficiency of the composite photocatalyst. On the other hand, C2 N forms a type II heterojunction with g-C3 N4 , which leads to efficient separation of photogenerated electron-hole pairs through the chemical potential difference between the two components. These results provide a potential route to achieve highly efficient metal-free photocatalysts for water splitting.