Helicobacter pylori#nbsp;(H. pylori) eradication by antibiotics and proton pump inhibitor treatment is limited by the low pH microenvironment in the stomach and can lead to antibiotic resistance. We fabricated fullerenol nanoparticles (FNPs) with varied chemical structures responding to a pinacol rearrangement of vicinal hydroxyl to form carbonyls in low pH environments. An obvious increase in C═O/C-O was induced in low pH and was positively correlated with a peroxidase-like activity. The FNPs exerted an excellent effect on#nbsp;H. pylori#nbsp;eradication in vitro and in vivo because of their peroxidase-like activity. FNP treatment of a#nbsp;H. pylori#nbsp;biofilm revealed that FNPs broke down polysaccharides in cell wall components, resulting in collapse of the bacteria. The cycles of FNPs combining and dissociating with the peroxidase substrate were detected by matrix-assisted laser desorption/ionization time-of-flight mass spectrometry and confirmed that FNPs enhance peroxidase-like activity. Further, the isothermal titration calorimetry results showed that FNPs with more C═O/C-O had greater affinity to bind the peroxidase substrates. Therefore, we suggest that varied C═O/C-O serves as a switch to respond to low pH in the stomach to kill#nbsp;H. pylori#nbsp;by inducing a peroxidase-like activity. FNPs can also overcome the challenge of antibiotic resistance to achieve#nbsp;H. pylori#nbsp;eradication in the stomach.