Previous literature has been diverging on cancer risk in people with multiple sclerosis (PwMS). Therefore, this study compared the risk of cancer in PwMS and a matched sample from the French general population. This 10-year nationwide retrospective matched cohort study (2012-2021) used data from the national French administrative health care database (99% coverage of the French population) to determine the time to the first incident cancer. PwMS were identified using their long-term disease (LTD) status, hospitalizations, and multiple sclerosis (MS)-specific drug reimbursements. The control population was matched 4:1 on age, sex, residence, insurance scheme, and cohort entry date. Participants were included if they had no history of cancer in the 3 years before inclusion. Patients with cancer were identified through LTD status, hospitalizations, chemotherapy, radiotherapy, or prostate cancer-specific drug reimbursements. Overall and cancer location-specific hazard ratios (HRs) for the first incident cancer were obtained from Fine and Gray models, and age- and sex-stratified estimates were reported. Participation in cancer screening through the 3 national programs (breast, colorectal, and cervical) were compared between groups. Cancer incidence was 799 per 100,000 person-years (PYs) (n = 8,368) among the 140,649 PwMS and 736 per 100,000 PYs (n = 31,796) among the 562,596 matched controls (70.8% of women; follow-up: 7.6 ± 3.2 years). A small overall risk increase was observed for PwMS (HR 1.06, 95% CI 1.03-1.08), mostly in women (HR 1.08, 95% CI 1.05-1.11). Risk varied by cancer types and was lower for prostate (HR 0.80, 95% CI 0.73-0.88), breast (HR 0.91, 95% CI 0.86-0.95), and colorectal (HR 0.90, 95% CI 0.84-0.97) cancer and higher for bladder (HR 1.71, 95% CI 1.54-1.89), brain (HR 1.68, 95% CI 1.42-1.98), and cervical (HR 1.24, 95% CI 1.12-1.38) cancer in PwMS. Cancer risk was higher in PwMS younger than 55 years (HR 1.20, 95% CI 1.15-1.24) but decreased in PwMS aged 65 years and older (HR 0.89, 95% CI 0.85-0.94). This trend was found in all cancer locations. There were fewer PwMS getting screened than controls (all programs), with a particularly pronounced difference among those aged 65 years and older. Cancer risk was slightly increased in PwMS, particularly for urogenital cancers, possibly due to surveillance bias. Risk fluctuated depending on age, perhaps due to varying generational screening practices (i.e., diagnosis neglect in the older PwMS) and risk factors.