Wastewater from the textile and dyeing industries contains hazardous dyes. This study aims to determine the effectiveness of magnetic biochar nanocomposites synthesized from khat leftovers (KLs) and coffee husks (CHs) in removing methylene blue (MB) from wastewater. Magnetic biochar nanocomposites were synthesized by pretreating 25 g of biomass with a 12.5 mmol mixture of FeS and FeCl3 at a 1:1 molar ratio, followed by pyrolyzing at 300°C for 1 h. The resulting products were analyzed using X‐ray diffraction, Fourier transform infrared, scanning electron microscope, and Brunauer‐Emmett‐Teller. The results showed that the adsorbents are amorphous, and the activated biochars, are more porous and contain various functional groups such as C‐O, C = C, O‐H, C‐H, and Fe‐O. When 0.2 g of pristine biochars of CH and KL were applied to 20 mL aqueous solutions containing 20 mg/L of MB at pH 7.5 and 25°C, they removed 44.73% and 75.26% of MB, respectively. However, the resulting nanocomposites exhibited a maximum removal efficiency of 99.10% and 99.23% with magnetic iron oxide‐CH biochar nanocomposite (Fe3O4‐CHBNC) and magnetic iron oxide‐KL biochar nanocomposite (Fe3O4‐KLBNC), respectively, with maximum adsorption capacities of 51.02 and 78.13 mg/g. The reusability study also showed removal efficiencies of 77.57% and 83.49% up to six‐cycle reuse.