In this study, the photocatalytic properties of AlN/TMO heterojunctions formed by coupling MoO2 and WO2 of transition metal oxides with AlN are studied in detail using first-principles calculations with the aim of finding efficient and low-cost photocatalysts for water splitting to produce hydrogen to reduce environmental pollution. The AIMD, phonon spectrum, and elastic constants demonstrated the thermodynamic, kinetic, and mechanical stabilities of the AlN/TMO heterojunction. The results showed that the AlN/MoO2 (1.55 eV) and AlN/WO2 (1.99 eV) heterojunctions have typical type-II energy band arrangements, which can effectively promote the separation of photogenerated electrons and hole pairs. Meanwhile, the AlN/MoO2 heterojunction showed excellent carrier mobilities (electron, 250.05 cm2 V-1 S-1 and hole, 45 467.07 cm2 V-1 S-1), which greatly exceeded those of each component. The AlN/WO2 heterojunction showed an excellent HER (-0.07 eV) performance, which was close to the expected value. For the AlN/WO2 heterojunction, a suitable band gap value, excellent HER, and other properties indicated that it has the potential to become a new candidate for photocatalytic water splitting. Our study enriches the theoretical research of transition metal oxide materials and wide-band gap materials by providing a reference direction for the design of reasonably high-quality photocatalysts.