Ternary complex oxides exhibit strong compositional dependence on their structure and functionalities. While the profound impact of the cation stoichiometry on the physical properties of ZnGa2O4 is widely recognized, how it affects the ultraviolet photodetection behavior remains not clear. Here we apply a combinatorial pulsed laser deposition technique to establish graded composition in ZnxGa1-xO (0 ≤ x ≤ 1) across a 2-inch sapphire substrate. In combination with structural and optical characterizations, a systematic investigation of the compositional effect on the phase, crystallinity and bandgap for the ZnxGa1-xO system is performed, and their further impact on the photodetection performance is compared by fabricating multiple metal–semiconductor-metal (MSM) photodetectors based on the graded ZnxGa1-xO films. Decent photodetection behavior is seen for the photodetectors with x ≤ 0.33, above which the performance is largely limited by the conductive phase formation. An optimized compositional range of x = 0.18–0.27 is identified to deliver the best device performance, which includes a responsivity of 12.88 A/W and a photo-to-dark current ratio of 2.8 × 108. This slight zinc deficiency is considered beneficial for the formation of moderate level of oxygen vacancies or antisite defects that boosts carrier transport. This study sheds light on the composition-dependent evolution of structure and properties in ternary ultrawide-bandgap semiconductors for high-performance ultraviolet photodetection.