Ibuprofen is a significant nonsteroidal anti-inflammatory drug that poses environmental and health risks when present in wastewater because of its persistence and probable toxicity. This study investigates the use of banana peel biochar (BPB) made at 600 °C to 900 °C to eliminate ibuprofen from aqueous solutions. The uniqueness of this work lies in the high-temperature pyrolysis process, which has not been previously explored for the ibuprofen removal efficiency using BPB. The batch experiment was conducted considering initial concentrations, pH, and contact time. The data were compared with different algorithms, with Linear Regression (LR), Support Vector Machines (SVM), Decision Trees (DT), Random Forest (RF), and k-Nearest Neighbor (k-NN) to forecast the performance. The results revealed that banana peel biochar at 900 °C exhibited the highest ibuprofen removal efficiency (69.28 ± 0.83%) at 125 mg/L concentration with the sequence of BPB900 > BPB800 > BPB700 > BPB600. A maximum removal efficiency of 72.67 ± 0.75% was observed at pH 9. Adsorption behavior was analyzed using isotherm and kinetic models, with the Freundlich isotherm model (R2 value 0.9620) indicating heterogeneous adsorption and the pseudo-second-order (PSO) kinetic model (R2 value 0.9969) suggesting that physicochemical interactions govern the process. FTIR analysis ensured the existence of functional groups (hydroxyl, carboxylic, carbonyl, and aromatic rings) responsible for adsorption. Machine learning algorithms, especially RF, demonstrated outstanding performance with 90.07% accuracy in predicting the experimental data. In comparison to other adsorbents, BPB demonstrated superior removal efficiency, underscoring its effectiveness. The study suggests that BPB, particularly at 900 °C, is effective in removing ibuprofen, and due to its sustainable production, it offers a potential solution for wastewater treatment.