In this study, the impact of pH on the production of ZnO nanostructured thin films using chemical bath deposition was investigated for the purpose of enhancing the efficiency of solar cells. The ZnO films were directly deposited onto glass substrates at various pH levels during the synthesis process. The results indicate that the crystallinity and overall quality of the material were not affected by the pH solution, as observed through X-ray diffraction patterns. However, scanning electron microscopy revealed that surface morphology improved with increasing pH values, leading to changes in the size of the nanoflowers between pH 9 and 11 values. Furthermore, the ZnO nanostructured thin films synthesized at pH levels of 9, 10, and 11 were utilized in the fabrication of dye-sensitized solar cells. The ZnO films synthesized at pH 11 exhibited superior characteristics in short-circuit current density and open-circuit photo-voltage compared with those produced at lower pH values.