This research explores using thermally modified residual coffee grounds as a bioadsorbent for removing methylene blue (MB) from aqueous solutions. The study investigates the impact of pH on adsorption capacity, emphasizing its significant influence. Kinetic studies reveal that the pseudo-first-order (PFO) model accurately describes the MB removal process, with correlation coefficients (R²) close to 1 for all samples. The Freundlich model provided the best fit for residual coffee grounds, while the Langmuir model was most suitable for biochar 1. The BiDR model provides the best fit with high R² values, indicating efficient removal for biochar 2 and biochar 3. Notably, the research shows that MB adsorption is effective without requiring pH adjustments, thereby reducing environmental impacts. The maximum adsorption capacities were 40.85, 20.35, 19.52 and 41.98 mg.g−1 using residual coffee grounds, biochar 1, biochar 2 and biochar 3, respectively. Overall, this study demonstrates the practicality of using thermally activated coffee grounds as an efficient adsorbent for removing textile dyes from effluents and highlights the potential of alternative uses for coffee grounds and biochar residues in environmental applications.