Abstract Nanoparticles of Cd1-x Zn x S (x = 0–0.8) were prepared in neat 1-ethyl-3-methylimidazolium ethyl sulfate, a halide-free and low-cost room-temperature ionic liquid (RTIL) via a simple heating method. The nanoparticles were investigated by means of powder X-ray diffraction, scanning electron microscopy, and UV-Vis diffuse reflectance spectroscopy techniques. The diffraction patterns demonstrate that the prepared nanoparticles in the RTIL have smaller size relative to the samples prepared in water. The photocatalytic activities of the nanoparticles towards photodegradation of methylene blue were evaluated under UV and visible irradiation. The results indicate that the nanoparticles prepared in the RTIL have greater photocatalytic activity relative to the samples prepared in water. The reaction rate constant under visible light irradiation on the nanoparticles prepared in the RTIL is at least six times greater than for the samples prepared in water.