Physical activity, sedentary behavior and risk of inflammatory bowel disease: a prospective cohort study in the UK Biobank Authors: Siqin Xia, Jie Zhang, Zixing Zhang, Xiang Wang, Dongqing Ye, Xinyu Fang Published: 2025 ABSTRACT BackgroundEvidence suggests that physical activity (PA) may mitigate chronic inflammation, while sedentary behavior (SB) could exacerbate gut dysbiosis—key mechanisms in inflammatory bowel disease (IBD). However, epidemiological data on their independent and joint associations with IBD risk remains inconsistent and inconclusive.ObjectiveThis cohort study aimed to examine the separate and joint association of PA and SB with IBD risk.MethodsThe research contained 355,021 people with no IBD at baseline in the UK Biobank. PA was measured using the International PA Questionnaire(IPAQ), calculating metabolic equivalent tasks (METs) min/wk based on the frequency and duration of walking, moderate, and vigorous activities. SB was assessed by self-reported total time spent driving, using computers, and watching television in a day. Using Cox proportional hazard models to evaluate the hazard ratios (HRs) and 95% confidence intervals (CIs) for IBD, Crohn’s disease (CD) and ulcerative colitis (UC) risks, while restricted cubic splines (RCS) assessing nonlinear relationships.ResultsDuring 13.6 years of follow-up, 2,242 incident IBD cases (664 CD and 1,481 UC) were recorded. Compared to the low level of PA, IBD risk was found to be lower for moderate and high PA, with HRs of 0.80 (95% CI: 0.72–0.89, p < 0.001) and 0.87 (95% CI: 0.78–0.98, p = 0.02), respectively. We also found a nonlinear correlation of PA with IBD risk (p < 0.05 for nonlinearity), with a moderate level of PA (~ 2000 MET min/wk) offering the lowest risk. Besides, each additional hour of SB per day increased IBD risk (HR: 1.03; 95% CI: 1.01–1.05; p < 0.001). The risk reduction from moderate and high levels of PA attenuated the adverse effects of long SB (≥ 6 h/day), decreasing the risk by 18% and 27%, respectively. The results of PA and SB together on IBD risk showed that participants with low PA and long SB have the highest IBD risk.ConclusionsThe results revealed that promoting PA and reducing SB synergistically lower IBD risk. Individuals combining high PA with lowest SB time are at the lowest probability of developing IBD.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12889-025-25647-z. Introduction Inflammatory bowel disease (IBD), including Crohn’s disease (CD) and ulcerative colitis (UC), is a lifelong illness for which there is presently no cure [1]. The prevalence rate adjusted for age rose from 79.5 (75.9–83.5) per 100,000 individuals in 1990 to 84.3 (79.2–89.9) per 100,000 individuals in 2017, with the USA recording the highest rate at 464.5 (438.6–490.9) per 100,000, followed by the UK at 449.6 (420.6–481.6) [2]. The chronic nature of the disease requires ongoing care, including frequent invasive procedures, hospitalizations, surgeries, and costly treatments, imposing significant social and economic burdens on health systems [3, 4]. Despite this, the treatment remains largely empirical. The etiology of IBD remains unclear, and with known genetic risk loci contributing to under 15% of the risk, identifying key modifiable environmental factors is a prerequisite for effective prevention of IBD [5]. Physical activity (PA) is a primary component of healthy lifestyle factors, defined as skeletal muscle-driven movements that increase energy expenditure, spanning activities across daily life domains (e.g. work, travel, chores, recreation) [6]. Evidence suggests that PA may suppress systemic inflammation by regulating IBD risk through anti-inflammatory pathways [7]. Studies have explored the link between PA and IBD risk, but epidemiological evidence on the beneficial impact of PA remains variable and ambiguous [8–10]. One European Prospective Cohort Study found no associations between PA and incident IBD [8]. The Nurses’Health Study documented 363 UC cases and 284 CD cases, and observed that PA linked to a decreased incidence of CD but not for UC among females aged 25 to 55 years [9]. Furthermore, a meta-analysis indicated that higher PA levels had a lower CD risk than people with low PA but there was no correlation observed for UC [10]. These studies were limited to focus female populations, only considered the role of PA in the pathogenesis of IBD, or failed to consider the interactive effects of sedentary behavior (SB), which is a distinct behavioral domain characterized by low energy expenditure during sitting, reclining, or lying postures [11]. PA and SB are not mutually exclusive but coexist as part of daily activity patterns, however, SB may independently influence IBD pathogenesis through intestinal barrier dysfunction and immune system activation [12, 13]. Given that robust evidence for IBD prevention is still lacking, and no studies have considered how different combinations of PA and SB may impact the risk of IBD [14–16]. Thus, based on such a general population cohort from the UK Biobank, with a large sample size, a long follow-up period, strict quality control, and standardized data collection methods, we performed research to explore the links of PA or SB with IBD, UC, and CD risks, explore the dose–response relationship, and also explore the interaction between PA and SB on the incidence of IBD. Methods Study population The study sample consisted of individuals from the UK Biobank, which combines large-scale, in-depth data, long-term follow-up, and is currently one of the largest and most data-rich prospective studies in the world, comprising 502, 359 people aged from 40 to 69 [17]. The cohort was established between 2006 and 2010 at 22 centers located throughout Scotland, England, and Wales, regular follow-up was conducted to update the data. All participants filled out a baseline questionnaire, which included information on lifestyle, anthropometric measures, and medications. This study utilized data from the UK Biobank (Application 62,663). The UK Biobank protocol received ethical approval from the North West Multicentre Research Ethics Committee (REC 11/NW/0382). Written informed consent was obtained from all enrolled participants prior to data collection. In the present study, we excluded the following: (1) participants diagnosed with IBD before baseline (n = 5,364); (2) missing PA and SB data at baseline (n = 119,974); (3) participants reporting unrealistic hours/day spent on SB (n = 50) and (4) outliers of PA (n = 21,950), the detailed information was presented in Supplementary Methods 1. Finally, 355,021 participants and 2,242 individuals with IBD were included in our study (664 incident cases of CD and 1,481 of UC) (Fig. 1 in Supplement). Assessment of PA and SB PA and SB were assessed by questionnaires at baseline. In detail, PA was evaluated through an altered version of the International PA Questionnaire (IPAQ), which recorded the frequency and duration of PA in walking, moderate and vigorous activities [18]. The metabolic equivalent tasks (METs) represents the ratio of energy expenditure for a particular activity compared to the resting state. MET values can evaluate the effects of exercise on the body. METs allocated to each PA category were multiplied by the weekly duration (minutes) to determine the continuous PA intensity (MET min/wk). MET values assigned were: 3.3 for walking, 4 for moderate activity, 8 for vigorous activity, and 0 for activities under 10 min per day. The sum of METs across all activity levels provided the total MET min/wk. Three groups were created from the total METs of the participants: low (< 600 MET min/wk), moderate (600–3000 MET min/wk), and high (> 3000 MET min/wk) PA, following the previous study [19]. SB information was calculated by totaling the time spent driving, computer use, and watching television reported at baseline. Entries exceeding 24 h per day were discarded, and reports of sedentary time exceeding 16 h per day were capped at 16 h [20]. Further details on the methods for assessing PA and SB are provided in Supplementary Table 1. Assessment of IBD In the present study, IBD, which encompasses CD (K50) and UC (K51), was identified based on the combination of self-reporting (1461, 1462, 1463) and ICD-10 codes [21], details are outlined in Supplementary Table 2. Data were sourced from hospital admission records, which contained diagnosis information drawn from event statistics in England, morbidity records in Scotland, and patient event registries in Wales. Participants who self-reported IBD at baseline were omitted in the analysis. Follow-up duration was established from recruitment to the earliest IBD diagnosis, loss to follow-up, death, or data censorship (31st Oct 2022), whichever event came first. Assessment of covariates Various covariates were included in our research, such as age (< 60 years or ≥ 60 years) [22], sex (female or male), Townsend deprivation index (TDI), educational level (college or below college), smoking status (never smoked, ex-smokers and current smokers), body mass index (BMI), ethnicity (White or others), alcohol drinker status (never, previous and current), household income (< £18,000, £18,000-£30,999, £31,000-£51,999, and ≥ £52,000), healthy diet scores (0–5 points) [23], cardiovascular disease (CVD), cancer, diabetes and Vitamin D supplementation. To account for genetic predisposition, polygenic risk scores (PRS) for UC and CD were included as covariates in this study. The PRS were derived from UK Biobank genotyping data following stringent quality control measures (e.g. exclusion of SNPs with low call rates or deviations from Hardy–Weinberg equilibrium) and population stratification adjustment [24]. Using a Bayesian framework and then incorporated multi-ancestry GWAS meta-analysis data, considering all genome-wide SNPs rather than just statistically significant variants. Individual PRS were calculated by summing the weighted products of posterior effect estimates (computed using LDpred2 to account for linkage disequilibrium) and corresponding allele counts (0/1/2) [25]. In our study, the scores were categorized into quintiles representing low (bottom 20%), intermediate (middle 60%), and high (top 20%) genetic risk groups [26]. The TDI is based on the residential postal codes of participants and calculates a composite measure that considers self-reported car ownership, home ownership, unemployment, and the extent of household overcrowding. Scores for a healthy diet are determined from the consumption of five categories of fruit, vegetables, processed meat, fish, and unprocessed red meat, and these scores vary from 0 to 5, with increased values indicating a healthier diet [27]. Statistical analysis According to three levels of PA (< 600 MET min/wk, 60–3,000 MET min/wk, and > 3,000 MET min/wk), using the lowest group as a reference, we summarized the individuals’ baseline characteristics [19]. Continuous variables were presented as means and standard deviations (SDs), while categorical variables were described as counts and percentages (%). Separate PA or SB with IBD risks were utilized using Cox models. To determine whether the assumption of the proportional risk was violated, we calculated the association between standardized Schoenfeld residuals and time [28]. In particular, we investigated the relationship among separate levels of PA and IBD, UC, and CD incidence. The SB levels were assessed as continuous variables. The separate analysis began with a Cox model that was minimally adjusted, incorporating age and sex (Model 1) and then adjusted for age, sex, ethnicity, educational level, TDI, smoking status, alcohol drinker status and household income (Model 2). When analyzing IBD subtypes, we additionally corrected for PRS scores of UC and CD in model 2. The connection between PA, SB and IBD, CD, and UC risks using hazard ratios (HRs) and 95% confidence intervals (CIs). The dose–response associations were assessed utilizing four-knot restricted curve splines (RCS). The stratified and joint associations were examined through a combination of PA and SB in model 2, SB was categorized into three groups: < 4 h/day, 4- < 6 h/day, and ≥ 6 h/day [29]. Moreover, subgroup analyses were performed based on age (< 60 years or ≥ 60 years), sex (female or male), BMI (< 25 kg/m2, 25- < 30 kg/m2 or ≥ 30 kg/m2), smoking status (never smoked, ex-smokers or current smokers) and alcohol drinker status (never, previous and current). Likelihood tests were used to test for multiplicative interaction by comparing models that include interaction terms with those that do not. To confirm the findings’ robustness, we carried out additional several sensitivity analyses. First, event cases less than two years of the study were eliminated in order to prevent reverse causality. Second, we made additional adjustments for BMI, healthy diet scores, vitamin D supplementation and health status (eg, cardiovascular disease, cancer, and diabetes), which helped to clarify the associations observed [27, 30–32]. Lastly, acknowledging that low levels of PA are common and irregular, which hinders accurate measurement by self-report questionnaires, we conducted separate analyses focusing on moderate and high levels of PA (MVPA) [33, 34]. This allows for a more precise evaluation of how PA levels impact the risk of developing IBD. To do statistical studies, R software was utilized (version 4.3.3). Statistical significance was defined as a two-sided p-value of < 0.05. Results Baseline characteristics In a median follow-up period of 13.6 years among 355,021 participants, there were 2,242 new cases of IBD, comprising 664 were CD and 1,481 were UC. In contrast to participants with low PA, those with higher levels were more likely to have a lower education level (31.6% vs. 36.5%), to be never smoked (54.5% vs. 43.9%), to be a previous or current alcohol drinker (3.6% vs. 4.6%), have a higher BMI (< 25: 37.1% vs. 26.4%), to be female (52.0% vs. 51.3%), and have a healthier diet scores (4–5: 30.0% vs. 16.9%) (all p < 0.05) (Table 1).Table 1Baseline participants’ characteristics by PA and SBCharacteristicsaPA MET min/wkb, No (%) (N = 355021)Low (n = 69226)Moderate (n = 191280)High (n = 94515)Education level College25248(36.5)76908(40.2)29880(31.6) Below college43978 (63.5)114372 (59.8)64635 (68.4) Smoking status Never smoked37280(53.9)107247(56.1)51555(54.5) Ex-smokers or current smokers31946 (46.1)84033 (43.9)42960 (45.5)SB (mean (SD))5.10 (2.84)4.41 (2.47)4.35 (2.36)Ethnicity White62685(90.6)174030(91.0)86599(91.6) Others6541 (9.4)17250 (9.0)7916 (8.4) Alcohol drinker status Never3212(4.6)6729(3.5)3395(3.6) Previous or current66014 (95.4)184551 (96.5)91120 (96.4)BMI < 2518263 (26.4)66583 (34.8)35040 (37.1) 25- < 3028273 (40.8)82694 (43.2)41030 (43.4) ≥ 3022690 (32.8)42003 (22.0)18445 (19.5)Sex Female35525(51.3)102273(53.5)49152(52.0) Male33701 (48.7)89007 (46.5)45363 (48.0)TDI (mean (SD))−1.37 (3.08)−1.50 (2.99)−1.43 (3.00) Age < 6043390(62.7)112542(58.8)51738(54.7) ≥ 6025836 (37.3)78738 (41.2)42777 (45.3)Household income Less than 18,00015144 (21.9)37748 (19.7)22274 (23.6) 18,000–30,99915598 (22.5)45719 (23.9)25723 (27.2) 31,000–51,99918265 (26.4)50818 (26.6)24780 (26.2) 52,000–100,00016126 (23.3)44073 (23.0)17372 (18.4) Greater than 100,0004093 (5.9)12922 (6.8)4366 (4.6)Healthy diet scoresc 0–119982 (28.9)38640 (20.2)15684 (16.6) 2–337534 (54.2)104682 (54.7)50482 (53.4) 4–511710 (16.9)47958 (25.1)28349 (30.0)CVD No46713(67.5)137763(72.0)68699(72.7) Yes22513 (32.5)53517 (28.0)25816 (27.3)Cancer No63802(92.2)176961(92.5)87353(92.4) Yes5424 (7.8)14319 (7.5)7162 (7.6)Diabetes No64254(92.8)182684(95.5)90775(96.0) Yes4972 (7.2)8596 (4.5)3740 (4.0)Vitamin D supplementation No68059(98.3)187676(98.1)92846(98.2) Yes1167(1.7)3604(1.9)1669(1.8)Abbreviations: PA Physical activity, MET Metabolic equivalent task, SB Sedentary behavior, BMI Body mass index, TDI Townsend deprivation index, CVD Cardiovascular diseaseaContinuous variables are displayed as means (SDs), and categorical variables are displayed as numbers (percentages)blow (< 600 MET × minutes per week), moderate (600–3000 MET × minutes per week), and high (> 3000 MET × minutes per week) physical activitycScores for a healthy diet are determined from consumption of five categories of fruit, vegetables, processed meat, fish, and unprocessed red meat Table 1Baseline participants’ characteristics by PA and SBCharacteristicsaPA MET min/wkb, No (%) (N = 355021)Low (n = 69226)Moderate (n = 191280)High (n = 94515)Education level College25248(36.5)76908(40.2)29880(31.6) Below college43978 (63.5)114372 (59.8)64635 (68.4) Smoking status Never smoked37280(53.9)107247(56.1)51555(54.5) Ex-smokers or current smokers31946 (46.1)84033 (43.9)42960 (45.5)SB (mean (SD))5.10 (2.84)4.41 (2.47)4.35 (2.36)Ethnicity White62685(90.6)174030(91.0)86599(91.6) Others6541 (9.4)17250 (9.0)7916 (8.4) Alcohol drinker status Never3212(4.6)6729(3.5)3395(3.6) Previous or current66014 (95.4)184551 (96.5)91120 (96.4)BMI < 2518263 (26.4)66583 (34.8)35040 (37.1) 25- < 3028273 (40.8)82694 (43.2)41030 (43.4) ≥ 3022690 (32.8)42003 (22.0)18445 (19.5)Sex Female35525(51.3)102273(53.5)49152(52.0) Male33701 (48.7)89007 (46.5)45363 (48.0)TDI (mean (SD))−1.37 (3.08)−1.50 (2.99)−1.43 (3.00) Age < 6043390(62.7)112542(58.8)51738(54.7) ≥ 6025836 (37.3)78738 (41.2)42777 (45.3)Household income Less than 18,00015144 (21.9)37748 (19.7)22274 (23.6) 18,000–30,99915598 (22.5)45719 (23.9)25723 (27.2) 31,000–51,99918265 (26.4)50818 (26.6)24780 (26.2) 52,000–100,00016126 (23.3)44073 (23.0)17372 (18.4) Greater than 100,0004093 (5.9)12922 (6.8)4366 (4.6)Healthy diet scoresc 0–119982 (28.9)38640 (20.2)15684 (16.6) 2–337534 (54.2)104682 (54.7)50482 (53.4) 4–511710 (16.9)47958 (25.1)28349 (30.0)CVD No46713(67.5)137763(72.0)68699(72.7) Yes22513 (32.5)53517 (28.0)25816 (27.3)Cancer No63802(92.2)176961(92.5)87353(92.4) Yes5424 (7.8)14319 (7.5)7162 (7.6)Diabetes No64254(92.8)182684(95.5)90775(96.0) Yes4972 (7.2)8596 (4.5)3740 (4.0)Vitamin D supplementation No68059(98.3)187676(98.1)92846(98.2) Yes1167(1.7)3604(1.9)1669(1.8)Abbreviations: PA Physical activity, MET Metabolic equivalent task, SB Sedentary behavior, BMI Body mass index, TDI Townsend deprivation index, CVD Cardiovascular diseaseaContinuous variables are displayed as means (SDs), and categorical variables are displayed as numbers (percentages)blow (< 600 MET × minutes per week), moderate (600–3000 MET × minutes per week), and high (> 3000 MET × minutes per week) physical activitycScores for a healthy diet are determined from consumption of five categories of fruit, vegetables, processed meat, fish, and unprocessed red meat Baseline participants’ characteristics by PA and SB Abbreviations: PA Physical activity, MET Metabolic equivalent task, SB Sedentary behavior, BMI Body mass index, TDI Townsend deprivation index, CVD Cardiovascular disease aContinuous variables are displayed as means (SDs), and categorical variables are displayed as numbers (percentages) blow (< 600 MET × minutes per week), moderate (600–3000 MET × minutes per week), and high (> 3000 MET × minutes per week) physical activity cScores for a healthy diet are determined from consumption of five categories of fruit, vegetables, processed meat, fish, and unprocessed red meat Association of PA and IBD incidence Our analysis revealed a notable association between separate PA or SB and IBD risk, detailed in Table 2. Following correction for age, TDI, sex, educational level, ethnicity, smoking status, alcohol drinker status and household income (model 2), we observed a reduced HR for IBD in individuals with moderate (HR, 0.80; 95% CI, 0.72–0.89; p < 0.001) and high PA levels (HR, 0.87; 95% CI, 0.78–0.98; p = 0.02) than those with low PA level.Table 2Associations between PA and SB with risk of incident IBD, CD and UCExposureLevelCase/nModel1aModel2bP value for trendHR (95%CI)P valueHR (95%CI)P valueInflammatory bowel diseasePhysical activitycLow509/687171 [Reference]1 [Reference]0.16Moderate1109/1901710.78(0.70, 0.86) < 0.0010.80(0.72, 0.89) < 0.001High624/938910.88(0.78, 0.99)0.030.87(0.78, 0.98)0.02Sedentary behaviordPer hour/day2242/3527791.05(1.03, 1.07) < 0.0011.03(1.01, 1.05) < 0.001 < 0.001Crohn’s diseaseePhysical activityLow154/690721 [Reference]1 [Reference]0.20Moderate344/1909360.80(0.66, 0.96)0.020.83(0.68, 1.00)0.05High166/943490.77(0.62, 0.96)0.020.77(0.62, 0.96)0.02Sedentary behaviorPer hour/day664/3543571.06(1.03, 1.09) < 0.0011.04(1.01, 1.07)0.01 < 0.001Ulcerative colitisfPhysical activityLow329/688971 [Reference]1 [Reference]0.95Moderate716/1905640.77(0.68, 0.88) < 0.0010.80(0.70, 0.92) < 0.001High436/940790.94(0.81, 1.08)0.390.94(0.81, 1.08)0.38Sedentary behaviorPer hour/day1481/3535401.04(1.02, 1.06) < 0.0011.02(1.00, 1.04)0.04 < 0.001Abbreviations: 95% CI 95% confidence interval, HR Hazard ratioaAdjusted for age, sexbAdjusted for age, sex, Ethnicity, smoking status, alcohol drinker status, education level, household income, TDIcLow (< 600 MET × minutes per week), moderate (600–3000 MET × minutes per week), and high (> 3000 MET × minutes per week) physical activitydAssessed as per 1 h of SB per day, regardless of PAeAdjusted for age, sex, Ethnicity, smoking status, alcohol drinker status, education level, household income, TDI, Polygenic risk score (PRS) of Crohn’s disease in model 2fAdjusted for age, sex, Ethnicity, smoking status, alcohol drinker status, education level, household income, TDI, Polygenic risk score (PRS) of Ulcerative colitis in model 2 Table 2Associations between PA and SB with risk of incident IBD, CD and UCExposureLevelCase/nModel1aModel2bP value for trendHR (95%CI)P valueHR (95%CI)P valueInflammatory bowel diseasePhysical activitycLow509/687171 [Reference]1 [Reference]0.16Moderate1109/1901710.78(0.70, 0.86) < 0.0010.80(0.72, 0.89) < 0.001High624/938910.88(0.78, 0.99)0.030.87(0.78, 0.98)0.02Sedentary behaviordPer hour/day2242/3527791.05(1.03, 1.07) < 0.0011.03(1.01, 1.05) < 0.001 < 0.001Crohn’s diseaseePhysical activityLow154/690721 [Reference]1 [Reference]0.20Moderate344/1909360.80(0.66, 0.96)0.020.83(0.68, 1.00)0.05High166/943490.77(0.62, 0.96)0.020.77(0.62, 0.96)0.02Sedentary behaviorPer hour/day664/3543571.06(1.03, 1.09) < 0.0011.04(1.01, 1.07)0.01 < 0.001Ulcerative colitisfPhysical activityLow329/688971 [Reference]1 [Reference]0.95Moderate716/1905640.77(0.68, 0.88) < 0.0010.80(0.70, 0.92) < 0.001High436/940790.94(0.81, 1.08)0.390.94(0.81, 1.08)0.38Sedentary behaviorPer hour/day1481/3535401.04(1.02, 1.06) < 0.0011.02(1.00, 1.04)0.04 < 0.001Abbreviations: 95% CI 95% confidence interval, HR Hazard ratioaAdjusted for age, sexbAdjusted for age, sex, Ethnicity, smoking status, alcohol drinker status, education level, household income, TDIcLow (< 600 MET × minutes per week), moderate (600–3000 MET × minutes per week), and high (> 3000 MET × minutes per week) physical activitydAssessed as per 1 h of SB per day, regardless of PAeAdjusted for age, sex, Ethnicity, smoking status, alcohol drinker status, education level, household income, TDI, Polygenic risk score (PRS) of Crohn’s disease in model 2fAdjusted for age, sex, Ethnicity, smoking status, alcohol drinker status, education level, household income, TDI, Polygenic risk score (PRS) of Ulcerative colitis in model 2 Associations between PA and SB with risk of incident IBD, CD and UC Abbreviations: 95% CI 95% confidence interval, HR Hazard ratio aAdjusted for age, sex bAdjusted for age, sex, Ethnicity, smoking status, alcohol drinker status, education level, household income, TDI cLow (< 600 MET × minutes per week), moderate (600–3000 MET × minutes per week), and high (> 3000 MET × minutes per week) physical activity dAssessed as per 1 h of SB per day, regardless of PA eAdjusted for age, sex, Ethnicity, smoking status, alcohol drinker status, education level, household income, TDI, Polygenic risk score (PRS) of Crohn’s disease in model 2 fAdjusted for age, sex, Ethnicity, smoking status, alcohol drinker status, education level, household income, TDI, Polygenic risk score (PRS) of Ulcerative colitis in model 2 We also explored the associations between PA and IBD subtypes, when we adjusted for age, TDI, sex, educational level, ethnicity, smoking status, alcohol drinker status, household income and PRS scores of UC or CD, we found that in model 2, in comparison with the low level of PA, a lower CD risk was linked to the high level (HR, 0.77; 95% CI, 0.62–0.96; p = 0.02). For UC, we observed that a moderate PA level can reduce the risk of UC (HR, 0.80; 95% CI, 0.70–0.92; p < 0.001), while high levels were non-significant (HR, 0.94; 95% CI; 0.81–1.08; p = 0.38). The results of RCS showed significant nonlinear associations between PA and IBD, UC, and CD risks (All p < 0.05 for nonlinearity). A nonlinear, U-shaped relationship between PA and IBD risk was exhibited, indicating that a moderate level of PA (~ 2,000 MET min/wk) was linked with the lowest incidence of IBD, CD, and UC (Fig. 2–4 in Supplement). Association of SB and IBD incidence As shown in Table 2, increasing daily sedentary time correlates with a higher risk of IBD and its subcategories. In model 1, each additional hour of SB per day is linked to an elevated of IBD risk (HR, 1.05; 95% CI, 1.03–1.07; p < 0.001), and remains significant after further adjustment in model 2 (HR, 1.03; 95% CI, 1.01–1.05; p < 0.001). In IBD subtypes, the HRs of SB were 1.04 (95% CI, 1.01–1.07; p = 0.01) with CD and 1.02 (95% CI, 1.00–1.04; p = 0.04) with UC. Interaction and joint analysis of PA and SB with the IBD incidence Joint impact on IBD risk was shown in Figs. 1 and 2. When stratified by PA levels, the excess risk for long SB (≥ 6 h/day) was reduced by 18% and 27% among those with moderate and high PA levels, in contrast to people with low PA level. In joint analyses, increased SB was associated with higher rates of IBD incidence across low, moderate, and high PA categories. (Fig. 1). However, we didn't note a significant multiplicative interaction between PA and SB concerning IBD (P for interaction = 0.80).Fig. 1The risk of incident IBD according to the stratifications of physical activity and sedentary behavior. HRs and 95% CIs were estimated with adjustment for age, sex, Ethnicity, smoking status, alcohol drinker status, education level, household income, TDI. Abbreviations: CI, confidence interval; HR, hazard ratioFig. 2Joint associations between physical activity and sedentary behavior with risk of incident IBD. HRs and 95% CIs were estimated with adjustment for age, sex, Ethnicity, smoking status, alcohol drinker status, education level, household income, TDI. Abbreviations: CI, confidence interval; HR, hazard ratio The risk of incident IBD according to the stratifications of physical activity and sedentary behavior. HRs and 95% CIs were estimated with adjustment for age, sex, Ethnicity, smoking status, alcohol drinker status, education level, household income, TDI. Abbreviations: CI, confidence interval; HR, hazard ratio Joint associations between physical activity and sedentary behavior with risk of incident IBD. HRs and 95% CIs were estimated with adjustment for age, sex, Ethnicity, smoking status, alcohol drinker status, education level, household income, TDI. Abbreviations: CI, confidence interval; HR, hazard ratio We discovered a dose-response connection between PA and SB with incident IBD (P for trend < 0.001). Opposed to participants with high PA and < 4 h/day SB, those with both low PA and long SB (HR, 1.26; 95% CI, 1.04–1.53.04.53; p = 0.02) faced the highest risk of incident IBD (Fig. 2). Subgroup analysis We also investigated the relationships of PA and SB with IBD risk in a number of subgroups, such as age, sex, BMI, smoking status, and alcohol drinker status (Fig. 5, Fig. 6 in Supplement). The relationships of PA and SB with IBD incidence remained consistent when stratified by age, smoking status, and alcohol drinker status (P for interaction all > 0.05). However, notable differences emerged when stratifying by sex and BMI, with effects being more pronounced in females and those with BMI < 25. Specifically, participants in females had a lower IBD incidence (HR, 0.74; 95% CI, 0.62–0.87), than males with high PA levels (HR, 1.04; 95% CI, 0.89–1.23). For individuals with BMI < 25, compared to BMI ≥ 25 and < 30, and BMI ≥ 30, possess a reduced chance of an incident IBD (HR, 0.69; 95% CI, 0.55–0.86; HR, 0.99; 95% CI, 0.83–1.19; HR, 0.97; 95% CI, 0.78–1.21; respectively) in a high level of PA. Additionally, females with long SB (HR, 1.30; 95% CI, 1.11–1.52) had a higher IBD risk than males (HR, 1.05; 95% CI, 0.91–1.22). Sensitivity analysis Sensitivity studies were conducted to guarantee the consistency of our conclusions, and the results are summarized in Supplementary Tables 3–6. We first removed participants who had followed on for fewer than two years, and we found the outcomes stayed the same. Besides, we conducted additional adjustments for BMI, healthy diet scores, CVD, cancer, vitamin D supplementation and diabetes, and the correlation of PA and SB with IBD risk was found to be robust. Finally, there was agreement between the main analysis and the results of an additional Cox regression analysis focusing on moderate-vigorous intensity PA (MVPA) and incident IBD. Discussion To our knowledge, this study first explored the combined association of PA, SB and the incidence of IBD. We found that IBD risk was linked with both PA and SB separately and jointly. We discovered that PA correlated with a reduced occurrence of IBD. In IBD subtypes, the associations of PA with CD incidence are comparable but not to UC. We also found a positive connection between SB and IBD, UC and CD incidence. More importantly, we further observed that the combination of low PA (< 600MET min/week) and long SB (≥ 6 h/day) had the highest risk for IBD. Our study provided evidence that there was a negative correlation between PA and IBD risk. A meta-analysis supported our finding showing a correlation that linked PA to a lower IBD risk [35]. We also observed the relationship between PA and the incidence of IBD subtypes. A previous prospective cohort study comprised 284 CD cases and 363 UC cases, however, differences with our study, they found that PA correlated with a lower CD incidence, but not to UC [9]. It is essential to highlight that by using a larger sample size, our study may have been better able to detect weak to moderate associations. To explore the optimal level of PA for reducing IBD incidence, a U-shaped and nonlinear relationship between PA and IBD was further examined in our study, and the findings suggested that encouraging moderate PA could help in preventing IBD. This is similar to an earlier cohort study that found moderate PA levels to a reduced occurrence of rheumatoid arthritis [26]. Considering that SB is another important component of daily activities in the general population, we conducted a joint effect study between PA and SB with the IBD risk. The combined impacts of PA and SB have been demonstrated in other diseases (eg. systemic lupus erythematosus, fibromyalgia) [36, 37]. In our study, compared to participants with high PA and < 4 h/day SB, the highest IBD risk was observed among individuals with low PA and long SB (≥ 6 h/day), although no significant multiplicative interaction between PA and SB was detected (P for interaction = 0.80), this indicates PA and SB are two crucial factors regulating IBD risk. These results emphasize the significance of interventions addressing both PA and SB may be more impactful in IBD prevention. Several plausible mechanisms have been suggested to clarify the relationship between PA, SB and IBD risk. First, the interaction mechanism between skeletal muscle, and gut inflammation suggests that exercise reduces inflammation by releasing anti-inflammatory cytokines and myokines from contracting muscles [38]. Second, in vivo studies have suggested that exercise can modulate autophagy, which is the lysosomal degradation pathway in skeletal muscle and myocardium, and susceptibility loci in the autophagy pathway in CD were also identified in a genome-wide association study [39]. It further revealed that the role of PA in IBD subtypes is different. The possible mechanism by which SB is viewed as a reasonable risk contributor for IBD is the increase in abdominal transit time in sedentary individuals, therefore more time is needed to mount immune responses to dietary and bacterial antigens in the gut [40]. Furthermore, too much SB means that muscles are not getting enough exercise, potentially causing a decline in muscle strength and mass, leading to muscle atrophy [41]. This may elucidate how sufficient PA mitigates the adverse effects of SB. However, the exact mechanism of the combined effect of PA and SB on the pathogenesis of IBD is still unclear, and needs to be further confirmed in future studies. Our study has some strengths. Firstly, extensive measurement of covariates, and long-term follow-up in the UK Biobank conduct multiple sensitivity analyses to reinforce our interpretation. Secondly, this study represented the inaugural prospective and systematic examination of the joint relationship between PA and SB with IBD incidence among the UK population we are aware of. Nevertheless, some of this study’s limitations should be noted. First, PA and SB information were reported at the baseline questionnaire and were assumed to be relatively stable during follow-up, which might be subject to some degree of misclassification. Future studies on changes in PA and SB over time will further clarify the relationship between these two behaviors and IBD pathogenesis. Then, not all unknown or unmeasured confounders can be fully controlled for in this observational study, so causal inferences between PA, SB and IBD should be made with caution. Furthermore, due to the relatively small sample size of the IBD subgroup, we did not further explore the potential combined effects of PA and SB in different subtypes of IBD. However, the direction of effect of PA and SB on overall IBD risk in the main analysis was shown to be largely across UC and CD subtypes. Future studies with large samples can further verify the heterogeneous effects of these behavioral factors in IBD subtypes. Finally, the UK Biobank may be subject to selection bias as individuals’characteristics could affect their likelihood of participating. Future research should deal with weights to reduce this potential bias as much as possible. Conclusion We found that both PA and SB are associated with IBD incidence and that the effects of PA differed among IBD subtypes. Individuals with both high PA and lowest SB exhibited the lowest IBD risk, indicating that promoting PA and reducing SB could be effective intervention strategies, potentially creating new avenues for the prevention and management of IBD. Supplementary Information Supplementary Material 1. Supplementary Material 1.