IntroductionIrritable Bowel Syndrome (IBS) is a chronic gastrointestinal disorder affecting a substantial portion of the global population. While the prevalence of IBS is well-documented worldwide, limited research has explored its occurrence and associated factors among medical students in Bangladesh, a population exposed to high academic stress. This cross-sectional study aimed to assess the prevalence of IBS among medical students and investigate its potential association with stress levels and the dormitory lifestyle. MethodsData were collected from 402 medical students using a self-administered questionnaire covering sociodemographic information, academic stress, lifestyle factors, and the Rome III Criteria for diagnosing IBS. Statistical analysis included bivariate and logistic regression analyses to identify significant associations and predictors of IBS prevalence. ResultsThis study among 402 university students found an overall irritable bowel syndrome (IBS) prevalence of 22.88 %, with 35.87 % diarrhea-predominant, 26.08 % constipation-predominant, and 38.04 % mixed subtype. Hostel residents had 2.11 times higher adjusted odds of IBS (95 % CI: 1.05–4.25, p < 0.001) than non-residents. IBS prevalence increased from 20.25 % for <1 year to 24.24 % for 1–3 years and 29.13 % for >3 years of hostel stay. Age 23–28 years (OR = 1.86, p = 0.030), lack of senior support (OR = 2.36, p = 0.05), second study phase (OR = 2.43, p = 0.002), inadequate exercise (OR = 2.11, p = 0.036), and frequent fatty food intake (OR = 2.98, p = 0.03) increased IBS risk. Higher academic stress (OR = 2.03, p = 0.002) predicted IBS, with 54.44 % vs. 43.78 % (p = 0.035) high stress among hostel residents who exercised less (48.23 % vs. 51.77 %) and consumed more fatty foods (53.33 % vs. 46.67 %). Mediation analysis revealed dormitory living impacts stress, physical activity, and diet - established IBS risk factors. ConclusionThe high prevalence of IBS among medical students in Bangladesh highlights the need for interventions to address changeable factors like academic stress, dormitory living conditions, lack of physical activity, and unhealthy eating habits to improve their health and wellness.