AIMS: To investigate whether Helicobacter pylori infection or autoimmune gastritis is responsible for the reported increase in gastric pathology and abnormalities of gastric function in patients with coeliac disease and dermatitis herpetiformis (DH). METHODS: Serum H pylori IgG antibodies were assayed by enzyme linked immunosorbent assay and intrinsic factor antibodies by radioimmunoassay in 99 patients with coeliac disease and 58 patients with dermatitis herpetiformis from two geographic areas. RESULTS: H pylori positivity in patients with coeliac disease and dermatitis herpetiformis increased with age, reaching 50% and 70%, respectively, in patients over 50 years. The percentage H pylori seropositivity in coeliac disease did not differ from the percentage positivity observed in 250 similarly aged blood donors from the same geographic area (Leeds). Seropositivity in patients with dermatitis herpetiformis was not significantly different from the level of positivity observed in 98 age matched patients without dermatitis herpetiformis attending the same Edinburgh dermatology clinic. Only one patient with coeliac disease had positive intrinsic factor antibodies. H pylori seropositivity in Edinburgh control subjects under 30 years of age (41.9%) was significantly higher (p less than 0.03) than in Leeds controls (18%) of corresponding age. An increasing prevalence of H pylori seropositivity with age in coeliac disease and dermatitis herpetiformis paralleled that of the control groups. CONCLUSIONS: Gastritis in coeliac disease and dermatitis herpetiformis is largely caused by H pylori infection at a level that is no different from that of the general population. Any increase in the prevalence of gastritis in these two diseases might be caused by lymphocytic gastritis rather than pernicious anaemia.