This study examined differences in glycated hemoglobin (HbA1c), fasting plasma glucose and cholesterol levels between H. pylori infected and uninfected persons with diabetes. Anonymized data of Maccabi Healthcare Services in Israel were analyzed, of 12,207 individuals (50.0% H. pylori positive) aged 25–95 years who underwent the urea breath test. The data included HbA1c, fasting plasma glucose and cholesterol levels. The inverse probability of treatment weighting approach was used to account for confounders. Differences between individuals who were H. pylori positive and negative, in HbA1c (> or ≤ 7.0%) and in cholesterol levels were assessed using weighted generalized estimating equations. For men, but not women, the likelihood of having HbA1c > 7.0% was increased in those infected than uninfected with H. pylori: prevalence ratio 1.11 (95% CI 1.00, 1.24), P = 0.04. For both sexes, total cholesterol (P = 0.004) and low-density lipoprotein (LDL) levels (P = 0.006) were higher among those infected than uninfected with H. pylori. No significant differences were found in glucose and HDL levels according to H. pylori infection. The results were consistent in unweighted multivariable analyses. In conclusion, H. pylori infection might be related to worse glycemic control in men, and higher total cholesterol and LDL cholesterol levels in both sexes.