Helicobacter pylori (H. pylori) causes sterility by affecting the reproductive system. Vitamin B12 improves sperm quantity and function. Vitamin B12 protection against H. pylori adverse effects was investigated. 40 C57 male mice (6 wk) were randomly assigned to 4 equal groups (n = 10) including, group 1 (control without any intervention), group 2 (H), 3 (HP), and 4 (HB) received 1 109 colony forming unit (CFU) of H. pylori, 1 109 CFU of H. pylori+phosphate buffered saline, 1 109 CFU of H. pylori+50 g/kg vitamin B intraperitoneally, respectively. In the induction groups, the H. pylori was orogasterically injected 3 times with 1 cc phosphate buffered saline throughout the day. Then testicular metrics, sperm motility, viability, quantity, and shape, plasma levels of malondialdehyde (MDA), superoxide dismutase, glutathione peroxidase, and total antioxidant capacity were measured. Also, testicular-tissue changes were examined using Johnson scores, tubular differentiation index, and spermatogenesis index. Vitamin B12, homocysteine, and testosterone serum levels were examined. The results showed a significantly lower Johnson score, tubular differentiation index, and spermatogenesis index, and serum level of testosterone and homocysteine as well as a higher MDA level in the H and HP groups than the HB group (p 0.05). In contrast, the highest superoxide dismutase and glutathione peroxidase enzymes activity and total antioxidant capacity as well as the lowest serum level of MDA were found in the HB group compared to other groups (p 0.05). Vitamin B increased antioxidant enzyme activity, enhanced sperm parameters, and decreased injury to testicular tissue. It can be used as a potent antioxidant in reducing testicular damage induced by H. pylori.