The fluoride species present in two different anodizing electrolytes were used to produce TiO2 nanotube arrays (TiO2 NTAs) by simultaneous anodic reaction and chemical dissolution. In this investigation, two different electrolytes were used for the preparation; [Eth-TiO2 NAs: 95 ml ethylene glycol+0.5% NH4F+5 ml DI water] and [Gly-TiO2 NAs: 75 ml glycerine+0.5% NH4F+25 ml DI water]. The effects of the prepared electrolytes used in the synthesis of TiO2 nanotube arrays on structural element composition, morphology, and optical properties are the focus of this study and are characterized by X-ray diffraction (XRD), scanning electron microscopy field emission (FE-SEM), energy-dispersive X-ray spectroscopy (EDX) and UV-vis diffusion reflection spectroscopy (DRS), respectively. The photoelectrochemical properties of TiO2 NTAs prepared in different electrolytes were investigated. The photoelectrochemical performance of TiO2 NTAs in Na2SO3 (0.1 M) and Na2S (0.1) was examined under the light of 100 mW/cm2 from a xenon lamp. Comparing the photoelectrochemical (PEC) results of both electrolytes, we find that Eth-TiO2 NTAs contribute a wide surface area resulting in an enhanced PEC response. TiO2 NTs, which were prepared with Eth-TiO2 NTAs, exhibited the highest photocurrent density, 0.326 mA cm–2, and photoconversion efficiency (0.22%).