KAlPO4F was prepared hydrothermally at 453 K, a time-saving method using cheap reagents. The white solid was characterized by different methods such as powder X-ray diffraction, thermal analysis, SEM and UV–Vis diffuse reflectance. The compound was successfully tested for the removal of methyl violet (MV), a hazardous dye. Experiments were carried out as a function of contact time, initial concentration, temperature and pH. The amount of dye uptake was found to vary with increasing initial solution pH and maximum adsorption was observed at pH 10; the equilibrium was attained in 270 min. The amount of dye uptake (mg/g) was found to increase with increase in dye concentration and contact time. The pseudo-first-order, pseudo-second-order, Elovich and intraparticle diffusion models were applied to fit the experimental data to elucidate the kinetic adsorption. The pseudo-second-order model was the best to describe the adsorption process. Different models analyzed the equilibrium isotherms; the applicability for the experimental data follows the order: Freundlich > Langmuir > Temkin. The thermodynamic parameters: ΔH° (39.034 kJ mol−1), ΔS° (134 J K−1 mol−1) and ΔG° (− 367.01 J mol−1) indicated that the adsorption process is endothermic and spontaneous with increasing disorder at the solid–solution interface.