ImportanceThere is increasing recognition from regulatory agencies that racial and ethnic representation in clinical trials is inadequate and linked to health inequities. The extent of racial inequities in clinical trial participation is unclear because prior studies have synthesized enrollment data from published trials, which often do not report participant race and ethnicity.ObjectiveTo evaluate racial and ethnic inequities in oncology clinical trial participation in a contemporary cohort of patients with cancer before and during the COVID-19 pandemic.Design, Setting, and ParticipantsThis cohort study used a nationwide electronic health record–derived deidentified database, which includes data for approximately 280 US cancer clinics (approximately 800 sites of care). The study included Latinx, non-Latinx Black (hereinafter, Black), and non-Latinx White (reference; hereinafter, White) patients aged 18 years or older who had been diagnosed with advanced non–small cell lung cancer, metastatic colorectal cancer, metastatic breast cancer, multiple myeloma, or metastatic pancreatic cancer between January 1, 2017, and June 30, 2022 (follow-up through December 31, 2022). Data analysis was performed between August 1, 2022, and February 7, 2023.ExposuresElectronic health record–documented race and ethnicity.Main Outcomes and MeasuresThe main outcome was oncology trial participation (ie, receipt of a clinical study drug). Stratified cause-specific hazard models were used to estimate adjusted hazard ratios (HRs) and 95% CIs for likelihood of participation. Participation was assessed overall, by cancer type, and by period of diagnosis (2017-2019 vs 2020-2022).ResultsOf the 50 411 patients in this study, 28 878 (57.3%) were women and 21 533 (42.7%) were men. Black and Latinx patients were younger than White patients, with a median age of 65 (IQR, 57-72), 64 (IQR, 54-73), and 68 (IQR, 60-76) years, respectively. Oncology trial participation was lower among Black patients (307 of 6912 [4.4%]) and Latinx patients (166 of 3973 [4.2%]) relative to White patients (2858 of 39 526 [7.2%]) over the entire study period. Inequities in participation were observed across the 5 cancer types studied, with notably large inequities observed among Black patients (HR, 0.54 [95% CI, 0.36-0.81]) and Latinx patients (HR, 0.46 [95% CI, 0.27-0.77]) with metastatic pancreatic cancer. Moreover, inequities between Black and White patients in terms of participation widened among those diagnosed in the COVID-19 era (2020-2022: HR, 0.49 [95% CI, 0.40-0.60] vs 1.00 [95% CI, 0.93-1.09]) relative to those diagnosed before the pandemic (2017-2019: HR, 0.61 [95% CI, 0.53-0.70] vs 1 [reference]).Conclusions and RelevanceThe findings of this cohort study suggest that oncology trial participation was lower among Black and Latinx patients relative to White patients across all 5 cancer types examined. These findings, including potentially widening inequities in the COVID-19 era, support the need for regulatory guidance to improve enrollment of participants from historically excluded racial and ethnic populations in clinical trials.