With the rise of detection technology, ultraviolet detection has received attention in civilian, military and other fields, which has aroused great research interest. ZnO has great development prospects in the field of ultraviolet photodetectors due to its excellent physical, optical, and electrical properties. This article uses magnetron sputtering method to sputter high-quality ZnO thin films on inexpensive glass substrates. The morphology, crystal phase, and optical absorption of ZnO thin films were characterized by SEM, XRD, and UV/Vis spectrophotometer. Metal-semiconductor-metal (MSM) structure Ti/ZnO ultraviolet photodetectors were prepared by vacuum evaporation. The effect of the number of interdigital electrodes on the performance of the photodetector was investigated by responsivity and I-V characteristic curves. The results show that the ZnO thin films prepared by magnetron sputtering are uniform and dense, have obvious ultraviolet absorption, and the performance of the photodetector is strongly dependent on the number of interdigital electrodes. When the working voltage is 10 V, the spectral response of the five pairs of interdigital electrodes is significantly enhanced (0.467 A/W). Therefore, this article provides certain reference values for the preparation and application of high-performance ZnO ultraviolet photodetectors.