PurposeIt is well demonstrated that being married is associated with a better prognosis in multiple types of cancer. However, whether the protective effect of marital status varied across race/ethnicity and gender in patients with hepatocellular carcinoma remains unclear. Therefore, we aimed to evaluate the roles of race/ethnicity and gender in this relationship.Patients and methodsWe identified eligible patients from Surveillance, Epidemiology and End Results (SEER) database during 2004–2012. Overall and cancer-specific survival differences across marital status were compared by Kaplan–Meier curves. We also estimated crude hazard ratios (CHRs) and adjusted hazard ratios (AHRs) with 95% confidence intervals (CIs) for marital status associated with survival by race/ethnicity and gender in Cox proportional hazard models.ResultsA total of 12,168 eligible patients diagnosed with hepatocellular carcinoma were included. We observed that married status was an independent protective prognostic factor for overall and cancer-specific survival. In stratified analyses by race/ethnicity, the AHR of overall mortality (unmarried vs married) was highest for Hispanic (AHR =1.25, 95% CI, 1.13–1.39; P<0.001) and lowest for Asian or Pacific Islander (AHR =1.13; 95% CI, 1.00–1.28; P=0.042). Stratified by gender, the AHR was higher in males (AHR =1.27; 95% CI, 1.20–1.33; P<0.001). Conclusion: We demonstrated that married patients obtained better survival advantages. Race/ethnicity and gender could influence the magnitude of associations between marital status and risk of mortality.