To investigate age- and sex-specific DNA methylation alterations related to cancer risk and survival, we used matched case-control studies of colorectal (N=835), gastric (N=170), kidney (N=143), lung (N=332), prostate (N=869) and urothelial (N=428) cancers, and mature B-cell lymphoma (N=438). Linear mixed-effects models were conducted to identify age-, sex- and age-by-sex-associated methylation markers using a discovery (controls) - replication (cases) strategy. Replication was further examined using summary statistics from Generation Scotland (GS). Associations between replicated markers and risk of and survival from cancer were assessed using conditional logistic regression and Cox models (hazard ratios [HR]), respectively. We found 32,659, 23,141 and 48 CpGs with replicated associations for age, sex and age-by-sex, respectively. The replication rates (GS summary data) for these CpGs were 94%, 86% and 91%, respectively. Significant signals for cancer risk and survival were identified at some individual age-related CpGs. There was a strong negative trend in the association between epigenetic drift and risk of colorectal cancer. Two CpGs overlapping TMEM49 and ARX genes were associated with survival of overall (HR=0.91, P=7.7×10−4) and colorectal (HR=1.52, P=1.8×10−4) cancer, respectively, with significant age-by-sex interaction. Our results may provide markers for cancer early detection and prognosis prediction.Simple SummaryAgeing is the strongest cancer risk factor, and men and women exhibit disparate risk profiles in terms of incidence and survival. DNA methylation is known to strongly vary by age and sex. Epigenetic drift refers to age-related DNA methylation changes and the tendency for increasing discordance between epigenomes over time, but it remains unknown to what extent the epigenetic drift might contribute to cancer risk and survival. The aims of this study were to identify age-associated, sex-associated and sexually dimorphic age-associated (age-by-sex-associated) DNA methylation markers and investigate whether age- and age-by-sex-associated markers are associated with cancer risk and survival. Our study, which used a total of 3,215 matched case-control pairs with DNA methylation in pre-diagnostic blood, is the first large study to examine the association between sex-specific epigenetic drift and cancer development and progression. The results may be useful for cancer early diagnosis and prediction of prognosis.