In the present study, undoped ZnO and CdZnO nanostructures with different weight ratios of cadmium were synthesized by the sol-gel method. Structural and optical properties were investigated by Fourier transform spectroscopy, UV-Vis spectroscopy, scanning electron microscopy, energy-dispersive analytical X-ray, X-ray diffraction, and photoluminescence spectroscopy methods. Moreover, the direct band gap is calculated by Tauc's approach. Furthermore, photocatalytic activity of all samples has been investigated under UV irradiation in an aqueous medium. Compared with pure ZnO, the band gap of the Cd-ZnO decreases and depends on the content of dopants. In addition, photocatalytic activity improves in the presence of a small amount (5 wt%) of cadmium dopant. Graphical Abstract