Abstract CdS–TiO2 nanocomposites were synthesized with various CdS weight ratios of 9%, 23%, 45% and 74% by the hydrothermal process. The prepared samples were characterized by X-ray diffraction (XRD), UV–visible diffuse reflectance spectroscopy (DRS), field emission scanning electron microscopy (FESEM), energy-dispersive X-ray spectroscopy (EDS) and Brunauer–Emmett–Teller (BET) analysis. Samples were coated on the surface of the perforated stainless steel and the photocatalytic activity of the catalysts was investigated under both UV–visible and visible irradiation to convert CO2 to carbon monoxide and methane. Significant improvement was observed for the activity of CdS–TiO2 nanocomposites compared with pure nano TiO2 under both UV–visible and visible light scattering in a batch gaseous reactor. The activity of CdS–TiO2 nanomaterial was found to be related to the CdS content and the size of nanoparticles. Maximum photocatalytic activity was observed for an optimal weight ratio of 45% CdS/TiO2 with 13nm average crystal size. The photocatalytic experiments were taken for 8h and formation of CO and CH4 was detected in gas phase, whereas CO production was five folds more than methane formation. Under UV–visible irradiation, photocatalytic activity of CdS–TiO2 for CO and CH4 formation was observed 35% and 50%, respectively, more than that under visible light.