Background: At present, the beneficial factors related to surgery at the primary tumor site in patients with stage IV gastric cancer (GC) are unclear. We developed a new selection process to determine the beneficial factors associated with primary tumor surgery.Methods: Patients with stage IV GC were screened from the Surveillance, Epidemiology, and End Results (SEER) database and were divided into surgery and non-surgery groups. The Kaplan-Meier method was used to estimate the survival curve before and after the propensity score-matched analysis (PSM). We believe that patients in the surgery group who have a longer median cancer-specific survival (CSS) time than those in the non-surgery group can benefit from surgery. Use Multivariate Logistic regression analysis to determine the benefit factors related to surgery.Results: A total of 7259 patients with stage IV GC were included, of which 29.95% (2174) underwent primary tumor surgery. After PSM, the median CSS of the surgery group and the non-surgery group was 12 months and 7 months, respectively (p < 0.001). Multivariate COX regression analysis showed that age, T stage, primary tumor site, histological classification, histological grade, and chemotherapy were independently correlated with CSS. We included the independent related factors affecting CSS in COX analysis in the multivariate Logistics regression model. The results showed that T stage, histological grade, and chemotherapy were related to surgical benefit.Conclusion: The surgery to the primary tumor site can prolong the survival time of patients with stage IV GC, and surgeons should screen patients before surgery. Our results show that patients with T stage T4b and histological grade GIII/GIV do not benefit from surgery, while patients receiving chemotherapy can benefit from surgery.