The present study is aimed to access the photodegradation efficiency of methylene blue dye using CoFe2O4 and Co0.1Al0.03Fe0.17O0.4 nanoparticles. The synthesis of spinel ferrites nanoparticles was performed by a facile sol-gel method. The synthesized nanoparticles were characterized by FTIR, XRD, SEM, EDS, Nitrogen adsorption/desorption and UV–Visible spectroscopy. The XRD studies confirmed the spinel cubic structure of ferrite. It was also found that the crystallinity increases at an annealing temperature of 800 °C. The application of these nanoparticles for methylene blue’s photocatalytic degradation was explored and also the optimization of several parameters involving dye’s concentration, amount of catalyst and pH of the solution was done. Photocatalytic degradation of methylene blue showed that at pH 11, using 200 W visible light bulb and in 120 min; 93% methylene blue dye was degraded by using 0.1 g of Co0.1Al0.03Fe0.17O0.4.