Concern has been raised about persistent sex disparities after coronary artery bypass grafting, with female patients having higher mortality. However, whether these disparities persist across hospitals of different qualities is unknown. To evaluate sex disparities in 30-day mortality after coronary artery bypass grafting across high- and low-quality hospitals. This cross-sectional, retrospective cohort study evaluated Medicare beneficiaries undergoing coronary artery bypass grafting between October 1, 2015, and March 31, 2020. Data analysis was performed from July 1, 2023, to December 1, 2023. The primary exposures were hospital quality and sex. For hospital quality, hospitals were placed into rank order by their overall risk-adjusted mortality rate and divided into quintiles. Risk-adjusted 30-day mortality using a logistic regression model accounting for patient factors, including sex, age, comorbidities, elective vs unplanned admission, number of bypass grafts, use of arterial graft, and year of surgery. A total of 444 855 beneficiaries (mean [SD] age, 71.5 [7.5] years; 120 333 [27.1%] female and 324 522 [72.9%] male) were studied. Compared with male beneficiaries, female beneficiaries were more likely to have an unplanned admission (66 425 [55.2%] vs 157 895 [48.7%], P < .001) and receive care at low-quality (vs high-quality) hospitals (odds ratio, 1.26; 95% CI, 1.23-1.29; P < .001). Overall, risk-adjusted female mortality was 4.24% (95% CI, 4.20%-4.27%), and male mortality was 2.75% (95% CI, 2.75%-2.77%), with an absolute difference of 1.48 (95% CI, 1.45-1.51) percentage points (P < .001). At the highest-quality hospitals, male mortality was 1.57% (95% CI, 1.56%-1.59%), and female mortality was 2.58% (95% CI, 2.54%-2.62%), with an absolute difference of 1.01 (95% CI, 0.97-1.04) percentage points (P < .001). At the lowest-quality hospitals, male mortality was 4.94% (95% CI, 4.88%-5.01%), and female mortality was 7.02% (95% CI, 6.90%-7.13%), with an absolute difference of 2.07 (95% CI, 1.95-2.19) percentage points (P < .001). Female beneficiaries receiving care at low-quality hospitals had a higher mortality than male beneficiaries receiving care at the high-quality hospitals (7.02% vs 1.57%, P < .001). In this cohort study of Medicare beneficiaries undergoing coronary artery bypass grafting, female beneficiaries were more likely to receive care at low-quality hospitals, where the sex disparity in mortality was double that of high-quality hospitals. Quality improvement targeting low-quality hospitals as well as equitable referral of female beneficiaries to higher-quality hospitals may narrow the sex disparity after coronary artery bypass grafting.