© 2022, The Author(s), under exclusive licence to Springer-Verlag GmbH, DE part of Springer Nature.In this work, undoped and cobalt-doped cadmium sulfide (CdS) films with different cobalt concentrations were grown on microscopic glass substrates using ultrasonic spray pyrolysis technique at 300 ± 5 °C substrate temperature. The influences of cobalt doping on electrical, optical, structural, and morphological properties of CdS films were studied. The four-probe technique measured the electrical resistivity of all films. XRD analysis showed that all films are in polycrystalline structures with hexagonal phases having (0 0 2) and (1 1 0) preferred crystal orientations. From SEM analysis, it has been seen that structured particles have not distributed homogeneously and well hold on the Pyrex glass substrate surface. The absorbance and light transmission in the 300–600 nm wavelength range characterized the optical properties. The optical properties of all films indicated high optical transparency in the visible region and a slight decrease of the direct band gap value from 2.46 to 2.37 eV, as the cobalt concentration in spray solution increases. The AFM images show that the increase of cobalt doping concentration increases the roughness of the films. From XRD diffraction patterns, the crystal structure of all films was shown as hexagonal systems. The increasing cobalt content did not significantly change the resistivity of the films. However, the undoped and cobalt-doped CdS films showed semiconducting behavior at room temperature. Since CdS is a highly resistive material, it is used as window material in photovoltaic solar cells.