The primary treatment method for eradicating Helicobacter pylori (H. pylori) infection involves the use of antibiotic-based therapies. Due to the growing antibiotic resistance of H. pylori, there has been a surge of interest in exploring alternative therapies. Cetylpyridinium chloride (CPC) is a water-soluble and nonvolatile quaternary ammonium compound with exceptional broad-spectrum antibacterial properties. To date, there is no documented or described specific antibacterial action of CPC against H. pylori. Therefore, this study aimed to explore the in vitro activity of CPC against H. pylori and its potential antibacterial mechanism. CPC exhibited significant in vitro activity against H. pylori, with MICs ranging from 0.16 to 0.62 μg/mL and MBCs ranging from 0.31 to 1.24 μg/mL. CPC could result in morphological and physiological modifications in H. pylori, leading to the suppression of virulence and adherence genes expression, including flaA, flaB, babB, alpA, alpB, ureE, and ureF, and inhibition of urease activity. CPC has demonstrated in vitro activity against H. pylori by inhibiting its growth, inducing damage to the bacterial structure, reducing virulence and adherence factors expression, and inhibiting urease activity.