IMPORTANCE: Bariatric surgery is the most effective treatment for severe obesity; yet it is unclear whether the long-term safety and comparative effectiveness of these operations differ across racial and ethnic groups. OBJECTIVE: To compare outcomes of Roux-en-Y gastric bypass (RYGB) and sleeve gastrectomy (SG) across racial and ethnic groups in the National Patient-Centered Clinical Research Network (PCORnet) Bariatric Study. DESIGN, SETTING, AND PARTICIPANTS: This was a retrospective, observational, comparative effectiveness cohort study that comprised 25 health care systems in the PCORnet Bariatric Study. Patients were adults and adolescents aged 12 to 79 years who underwent a primary (first nonrevisional) RYGB or SG operation between January 1, 2005, and September 30, 2015, at participating health systems. Patient race and ethnicity included Black, Hispanic, White, other, and unrecorded. Data were analyzed from July 1, 2021, to January 17, 2022. EXPOSURE: RYGB or SG. OUTCOMES: Percentage total weight loss (%TWL); type 2 diabetes remission, relapse, and change in hemoglobin A1c (HbA1c) level; and postsurgical safety and utilization outcomes (operations, interventions, revisions/conversions, endoscopy, hospitalizations, mortality, 30-day major adverse events) at 1, 3, and 5 years after surgery. RESULTS: A total of 36 871 patients (mean [SE] age, 45.0 [11.7] years; 29 746 female patients [81%]) were included in the weight analysis. Patients identified with the following race and ethnic categories: 6891 Black (19%), 8756 Hispanic (24%), 19 645 White (53%), 826 other (2%), and 783 unrecorded (2%). Weight loss and mean reductions in HbA1c level were larger for RYGB than SG in all years for Black, Hispanic, and White patients (difference in 5-year weight loss: Black, -7.6%; 95% CI, -8.0 to -7.1; P < .001; Hispanic, -6.2%; 95% CI, -6.6 to -5.9; P < .001; White, -5.9%; 95% CI, -6.3 to -5.7; P < .001; difference in change in year 5 HbA1c level: Black, -0.29; 95% CI, -0.51 to -0.08; P = .009; Hispanic, -0.45; 95% CI, -0.61 to -0.29; P < .001; and White, -0.25; 95% CI, -0.40 to -0.11; P = .001.) The magnitude of these differences was small among racial and ethnic groups (1%-3% of %TWL). Black and Hispanic patients had higher risk of hospitalization when they had RYGB compared with SG (hazard ratio [HR], 1.45; 95% CI, 1.17-1.79; P = .001 and 1.48; 95% CI, 1.22-1.79; P < .001, respectively). Hispanic patients had greater risk of all-cause mortality (HR, 2.41; 95% CI, 1.24-4.70; P = .01) and higher odds of a 30-day major adverse event (odds ratio, 1.92; 95% CI, 1.38-2.68; P < .001) for RYGB compared with SG. There was no interaction between race and ethnicity and operation type for diabetes remission and relapse. CONCLUSIONS AND RELEVANCE: Variability of the comparative effectiveness of operations for %TWL and HbA1c level across race and ethnicity was clinically small; however, differences in safety and utilization outcomes were clinically and statistically significant for Black and Hispanic patients who had RYGB compared with SG. These findings can inform shared decision-making regarding bariatric operation choice for different racial and ethnic groups of patients.