Chitosan nanoparticles have been prepared from the stalks of Agaricus bisporus mushroom via ionic gelation according to the connection between positive chitosan and negative tripolyphosphate (TPP). chitosan nanoparticles diagnosed via Fourier Transform Infrared (FTIR); the size and shape of chitosan nanoparticles are tested by Scanning Electron Microscope (SEM) and Atomic Force Microscope (AFM). chitosan nanoparticles have been tested in inhibiting Aspergillus flavus in the concentrations (0.5, 1, 1.5, 2) %. The chitosan nanoparticles inhibition rate of the fungus has reached (35, 100, 100, 100) % respectively. tested The effectiveness chitosan nanoparticles in preventing A. flavus from producing Aflatoxin B1 in the concentrations (0.5, 1, 1.5) %. The rate of Aflatoxin B1 production inhibition by chitosan nanoparticles has reached (75.7, 100, 100) % respectively after 21 days of incubation at 28 degrees after estimating Aflatoxin B1 via HPLC. The study has proven that the effectiveness of chitosan nanoparticles in inhibiting the growth of A. flavus and inhibiting the production of Aflatoxin B1 from the fungus.