The relationship between chronic Helicobacter pylori (HP) infection and headache has been discussed for long; nevertheless, the results of the studies are still contrasting. This cross-sectional study is aimed to investigate a possible association between HP and headache, mainly migraine. We screened, by a self-administered questionnaire, the subjects undergoing a breath test or an esophagogastroduodenoscopy. Migraine was diagnosed according to the international criteria. A total of 3914 patients underwent a breath test and 2200 an esophagogastroduodenoscopy at two hospitals, in Piedmont (Italy), in a 5-year period; a total of 1362 questionnaires were included in the study. The mean age of the subjects was 53years; there were 777 women (57%). HP was detected in 364 (27%) subjects. A total of 702 (51%) subjects suffered from headache: migraine with aura was diagnosed in 176 subjects (176/702, i.e., 25% of the headache group; 176/1362, i.e., 13% of the total population); migraine without aura in 98 subjects (98/702, i.e., 14% of the headache group; 98/1362, i.e., 7% of the total). The logistic regression model did not detect any significant association between HP infection and headache, while a significant association between HP and headache frequency (p =0.009) was found, independently of age, gender, comorbidity, and diagnostic category. Our study does not reveal an association between chronic HP infection and migraine. However, since HP is significantly associated with higher headache frequency, a role for HP as a risk factor for headache chronification, possibly underlain by inflammatory mechanisms, may be supposed.