This study was designed to assess the effects of surgery method on overall survival (OS) and cancer-specific survival (CSS) in patients with hepatocellular carcinoma (HCC). This is a retrospective study. Patients diagnosed with primary HCC (N = 10,174) were identified from the Surveillance, Epidemiology, and End Results Database from 2010 to 2017 and categorized into surgical (N = 4950) and nonsurgical (N = 5224) groups. The characteristics of patients were balanced by propensity score matching. Multivariate Cox analysis was used to explore independent prognostic factors for outcomes in both groups, and the Kaplan-Meier curve showed survival rates in each group. The surgical patients were subclassified by surgical method, whether local tumor destruction, wedge or segmental resection, lobotomy resection, or liver transplantation (LT). Finally, survival rates in the 2 groups were investigated by subgroup analysis. After propensity score matching, sex, grade, tumor node metastasis III/IV, surgery, chemotherapy, alpha-fetoprotein, number of regional lymph nodes, other race, and age > 70 were independent prognostic factors in the 2 groups. The OS (HR = 0.290, P < .001) and CSS (HR = 0.274, P < .001) rates of patients were higher in the surgical group than in the nonsurgical group. There was no obvious improvement in CSS in patients who received radiotherapy combined with surgery compared with patients who only received radiotherapy (HR = 0.813, P = .279). LT was consistently found to be the best of the 4 surgical methods. The OS of stage II patients undergoing LT was better than that of corresponding stage III patients, and lobectomy resection was the best choice for stage IV patients (HR = 0. 417, P = .023). In grade III patients, the median CSS time was longer than the OS time. The survival rate of patients treated with chemotherapy combined with LT was higher than that of patients who did not receive chemotherapy and only received LT. Patients with HCC who underwent surgery had better OS and CSS. Subgroup analysis showed that LT can improve the survival rate and median survival time of patients.