The need for efficient, cost-effective and environmentally friendly methods to remove pollutants from wastewater streams is increasing due to efforts to recycle water in the face of growing water scarcity. In this study, the removal efficiency of adsorption with pristine and Fe-modified hydrochars and biochars derived from wheat straw was evaluated using the dye Rhodamin B (RhB). The chemical and physical properties of adsorption were determined. The adsorbents were characterized using field emission scanning electron microscopy (SEM), energy dispersive- X ray spectroscopy (EDAX), X-ray diffraction (XRD), Brunauer–Emmett–Teller (BET), X-ray fluorescence spectroscopy (XRF), fourier transform infrared spectroscopy (FTIR), thermogravimetric analysis (TGA), and atomic force microscopy (AFM). The results of characterization analysis indicated that Fe-modified hydrochar has higher voids, roughness, and specific surface area compared to other adsorbents and its mean particle size was about 30 nm. Adsorption experiments showed that Fe modification increased the removal efficiency of biochar and hydrochar. An optimum RhB adsorption efficiency of 91 % was achieved with Fe-modified hydrochar at a concentration of 1 g L−1, pH initial of 6 with a RhB concentration of 5 mg L−1 during 90 min. The data were completely fitted to langmuir and freundlich isotherms which suggested a monolayer as well as multilayer adsorption. The maximum adsorption capacity (qmax) was 80 mg g−1. Data were fitted with pseudo-second-order kinetic model and adsorption was affected by both physical and chemical mechanisms. The E value was 7.58 KJ mol−1, which indicates physical adsorption of RhB and endothermic remediation process, which increases at a higher temperature. The model developed using the genetic programming approach was able to predict RhB removal with an average absolute error of 6.74 %, and a sensitivity analysis showed that by increasing the contact time, the most effective factor, the RhB removal is increased. Results of this study suggest Fe-modified hydrochar derived from wheat straw is an efficient and cost-effective adsorbent for the removal of dye from wastewater.