ABSTRACT: Background: We aimed to explore the relationship between lifestyle factors, cancer family history, and gastric cancer risk. Methods: We examined the association between lifestyle factors, cancer family history, and gastric cancer risk based on a population-based case-control study in Taixing, China, with 870 cases and 1928 controls. A lifestyle score was constructed considering body shape, smoking, alcohol drinking, tooth brushing habit, and food storage method. Unconditional logistic regression models were used to calculate odd ratios (ORs) and 95% confidence intervals (CIs). Results: Compared with participants with a lifestyle score of 0, subjects with a lifestyle score of 1 (OR 0.59, 95%CI 0.43-0.83), 2 (OR 0.42, 95%CI 0.30-0.59), 3 (OR 0.29, 95%CI 0.20-0.41), 4 (OR 0.20, 95%CI 0.13-0.32), or 5 (OR 0.10, 95%CI 0.04-0.22) had a lower risk of gastric cancer (P for trend < 0.001). Overall, 34% of gastric cancer cases (95%CI 27-41%) can be attributed to non-compliance with ≥3 healthy lifestyle. Family history of early-onset cancer is closely related to the occurrence of gastric cancer, with an OR ranging from 1.77 to 3.27. Regardless of family history, a good lifestyle is associated with a reduced risk of gastric cancer, with an OR value between 0.38 and 0.70. Conclusions: The early-onset cancer family history is closely related to the occurrence of gastric cancer and a good lifestyle is associated with a reduced risk of gastric cancer regardless of family history. Our results provide a basis for identifying and providing behavior guidance of high-risk groups of gastric cancer.