Background. The association between nonalcoholic fatty liver disease (NAFLD) and Helicobacter pylori (H. pylori) is controversial. We conducted a retrospective study to clarify the seroprevalence of H. pylori infection and the relationship between NAFLD and H. pylori infection in north urban Chinese. Methods. The retrospective study was performed at Aerospace Center Hospital in Beijing. All subjects in this study were a healthy population who underwent health examinations at the hospital between 2012 and 2015. A logistic regression model was used to calculate the association between NAFLD and H. pylori infection. Age, gender, underlying diseases, and metabolic syndrome (MS) were adjusted. Effects of NAFLD on H. pylori infection in a different age, gender, and number of MS characteristic subgroups were analyzed. Results. There were 7803 (43.4%) subjects with H. pylori infection, 3726 (20.7%) with mild NAFLD, 730 (4.1%) with moderate NAFLD, and 369 (2.1%) with severe NAFLD among 17971 subjects. H. pylori infection was related to the seroprevalence of any level of NAFLD, including mild, moderate, and severe NAFLD (OR=1.607, 95% CI: 1.487-1.736; OR=1.770, 95% CI: 1.519-2.063; and OR=2.120, 95% CI: 1.714-2.526, respectively). The results of subgroup analysis showed that the risk of incident NAFLD from H. pylori infection had significant interactions by subjects with or without MS characteristics. Moreover, as the number of MS characteristics in patients with a fatty liver increased, the risk of H. pylori infection also increased. Conclusions. NAFLD may be associated with H. pylori infection in a Chinese population. Younger, male NAFLD patients and those meeting more characteristics of MS were more likely to have H. pylori infection.