The current investigation aims to establish a connection between IL17 gene polymorphisms and H. pylori infection. Seventy-eight (78) cases were gathered with H. pylori infection-related clinical symptoms. Urea breath testing and rapid Ab immunoassay, two assays, identified 45 patients with H. pylori infection. As a control group, samples from 45 people were collected who appeared to be in good health. It has been determined that the gold standard method for non-invasive diagnosis is the urea breath test. Additionally, the interleukin 17 gene was found using ELISA, sequencing, and conventional PCR methods. It was discovered that genotype A/A was more closely related to infection, but genotype G/A provided carriers with a lesser susceptibility to infection. This demonstrated the link between H. pylori infection and phenotypes. The risk allele is represented by allele A, with a 95% confidence interval (CI) of 2.30 (1.25–4.21), whereas the protective allele is represented by allele G, with a CI of 0.43 (odd) (0.24–0.80). The mean concentration of interleukin 17 in the H. pylori infection group was 97.85±39.54 pg/ml, which was higher than the 75.58 ±22.74 pg/ml in the control group. The A/A genotype in the IL-17 gene (rs2275913) showed the highest concentration of IL-17 (114.24 pg/ml) in the serum of these studied groups, while the average serum level of the G/A (78.37 pg/ml) and G/G groups (76.13 pg/ml) was obtained from the comparison between the level of IL-17 and the genotypes of the IL-17 gene.