Background Evidence is suggestive of sedentary behaviour being associated with an increased risk of endometrial cancer, but the evidence base is too limited to draw any conclusions for other cancers. The aim of the study was to investigate the association between sedentary behaviour and total cancer incidence and site-specific cancer incidence.Methods This prospective population-based cohort study involved data from the UK Biobank (470 578 adults; 53.8% females; mean age 56.3 years). Sedentary behaviours including television viewing time, computer use time and daily total screen time were the exposure variables. Primary and secondary outcome measures included incident total cancer, and site-specific cancers identified from the International Classification of Diseases, 9th and 10th revisions (ICD-9 and ICD-10). Cox proportional hazards models were used to estimate hazard ratios (HRs) and 95% confidence intervals (CIs) showing the relationship between sedentary behaviour and cancer using continuous (hours/day) and categorical exposure variables. Partition models and isotemporal substitution models were used to investigate the impact of substituting sedentary behaviour with physical activity.Results During a mean follow-up time of 7.6 years, 28 992 incident cancers were identified. A 1-hour increase in daily TV screen time was associated with higher risk of oropharyngeal cancer (HR 1.06, 95% CI: 1.02, 1.11), stomach cancer (HR 1.06, 95% CI: 1.001, 1.13), oesophagus and stomach cancer (HR 1.04, 95% CI: 1.005, 1.09), and colon cancer (HR 1.04, 95% CI: 1.01, 1.06) in fully adjusted models. Participants who reported ≤1 hour/day of TV screen time had a lower risk of lung cancer (HR 0.85, 95% CI: 0.73, 0.997), breast (female only) cancer (HR 0.92, 95% CI: 0.85, 0.996), stomach cancer (HR 0.66, 95% CI: 0.45, 0.97), and oesophagus and stomach cancer (HR 0.78, 95% CI: 0.62, 0.98) compared to participants who reported 1-≤3 hours/day of TV screen time. Isotemporal substitution models showed reduced risk of total cancer (HR 0.97, 95% CI: 0.95, 0.99) and some site-specific cancers when replacing 1-hour/day of TV viewing with moderate-intensity physical activity or walking.Conclusions Our findings show that sedentary behaviours were associated with some site-specific cancers (including oropharyngeal, oesophagus and stomach, colon and lung cancer), particularly for TV viewing time. Our findings were less consistent for time spent on computer and daily total screen time. Substitution models showed that replacing 1-hour per day of TV viewing with 1-hour of moderate-intensity physical activity or walking was associated with lower risk of total cancer and lower risk of several site-specific cancers. Health promotion strategies should endorse the message to minimise sedentary behaviour, replacing it with health-enhancing physical activity, and to particularly target TV viewing.