Although bariatric surgery is effective against morbid obesity, the association of this surgery with the risk of colorectal cancer remains controversial. To assess whether bariatric surgery is associated with altered risk of colorectal cancer among individuals with obesity. This retrospective, population-based, multicenter, cohort study based on French electronic health data included 1 045 348 individuals with obesity, aged 50 to 75 years, and free of colorectal cancer at baseline. All inpatients with obesity having data recorded during a hospital stay between 2009 and 2018 by the French national health insurance information system database were followed up for a mean (SD) of 5.3 (2.1) years for those who did not undergo bariatric surgery and 5.7 (2.2) years for those who underwent bariatric surgery. Two groups of patients comparable in terms of age, sex, body mass index, follow-up, comorbidities, and conditions who did or did not undergo surgery were also obtained by propensity score matching. Bariatric surgery (n = 74 131), including adjustable gastric banding, sleeve gastrectomy, gastric bypass; or no bariatric surgery (n = 971 217). Primary outcome was incident colorectal cancer. Standardized incidence ratios were calculated using age-, sex-, and calendar year-matched colorectal cancer incidence among the general French population during the corresponding years. Secondary outcome was incident colorectal benign polyps. Among a total of 1 045 348 patients, the mean (SD) age was 57.3 (5.5) years for the 74 131 patients in the surgical cohort vs 63.4 (7.0) years for the 971 217 patients in the nonsurgical cohort. The mean (SD) follow-up was 6.2 (2.1) years for patients who underwent adjustable gastric banding, 5.5 (2.1) years for patients who underwent sleeve gastrectomy, and 5.7 (2.2) years for patients who underwent gastric bypass. In total, 13 052 incident colorectal cancers (1.2%) and 63 649 colorectal benign polyps were diagnosed. The rate of colorectal cancer was 0.6% in the bariatric surgery cohort and 1.3% in the cohort without bariatric surgery. In the latter cohort, 9417 cases were expected vs 12 629 observed, a standardized incidence ratio of 1.34 (95% CI, 1.32-1.36). In the bariatric surgery cohort, 428 cases were expected and 423 observed, a standardized incidence ratio of 1.0 (95% CI, 0.90-1.09). Propensity score-matched hazard ratios in comparable operated vs nonoperated groups were 0.68 (95% CI, 0.60-0.77) for colorectal cancer and 0.56 (95% CI, 0.53-0.59) for colorectal benign polyp. There were fewer new diagnoses of colorectal cancer after gastric bypass (123 of 22 343 [0.5%]) and sleeve gastrectomy (185 of 35 328 [0.5%]) than after adjustable gastric banding (115 of 16 460 [0.7%]), and more colorectal benign polyps after adjustable gastric banding (775 of 15 647 [5.0%]) than after gastric bypass (639 of 20 863 [3.1%]) or sleeve gastrectomy (1005 of 32 680 [3.1%]). The results of this nationwide cohort study suggested that following bariatric surgery, patients with obesity share the same risk of colorectal cancer as the general population, whereas for patients with obesity who do not undergo bariatric surgery, the risk is 34% above that of the general population.