The demand for clean water has become a worldwide problem because of the pollutants' excessive and inappropriate use. In this regard, a new hydrogel nanocomposite adsorbent was fabricated from xanthan gum and graphene oxide via free radical polymerization for methylene blue (MB) dye removal. The physicochemical properties of the synthesized hydrogel nanocomposite were evaluated using scanning electron microscopy (SEM), x-ray photoelectron spectroscopy (XPS), x-ray diffraction (XRD), Fourier transform infrared (FTIR), and thermogravimetric analysis (TGA). The properties of the bare hydrogel and the adsorption of MB dye in an aqueous solution were enhanced by adding graphene oxide to the hydrogel matrix. The batch adsorption experiment revealed a maximum adsorption capacity of 1008 mg/g for the prepared hydrogel nanocomposite, using 250 mg/L of MB dye at pH 7 over the course of an hour. The findings of the adsorption kinetics model suggested that the order of the adsorption process of the prepared hydrogel nanocomposite is fitted well with pseudo-second-order kinetics. The regeneration study demonstrated excellent recyclability for the synthesized nanocomposite across five successive reusable cycles. The findings from the point of zero charge (pzc) and FTIR investigations indicate that electrostatic attraction is the primary force between the adsorbent and the dye molecules.