Adverse childhood experiences (ACE) are associated with increased risk of irritable bowel syndrome (IBS), a female-predominant chronic abdominal disorder. Factors contributing to this association have not been well-studied. We compared sex differences in ACE for adults with and without IBS and evaluated the impact of anxiety and resilience on the relationship between ACE and IBS. Sex and disease differences in total score and ACE subtypes from the ACE Questionnaire in subjects with IBS and control subjects were assessed. Cross-sectional mediation analysis determined if anxiety (Hospital Anxiety and Depression Scale) and resilience (Connor-Davidson Resilience Scale or Brief Resilience Scale) mediated the relationship between ACE and IBS. Of 798 participants studied, 368 met IBS diagnostic criteria (265 women, 103 men) and 430 were healthy control subjects (277 women, 153 men). Prevalence and number of ACE were higher in IBS versus control subjects (P < .001) but similar between IBS women and men. Household mental illness increased odds of having IBS in women (odds ratio [OR], 1.95; 95% confidence interval [CI], 1.35-2.85; false discovery rate [FDR], 0.002) and men (OR, 2.32; 95% CI, 1.26-4.33; FDR, 0.014). Emotional abuse increased odds of having IBS in women (OR, 1.94; 95% CI, 1.23-3.09; FDR, 0.019) and sexual abuse increased odds of IBS in men (OR, 3.54; 95% CI, 1.35-10.38; FDR, 0.027). Anxiety mediated 54% (P < .001) of ACE's effect on IBS risk and resilience mediated 12%-14% (Connor-Davidson Resilience Scale, P= .008; Brief Resilience Scale, P= .018). Both men and women with a history of ACE are twice as likely to have IBS than those without an ACE. Anxiety mediated the relationship between ACE and IBS in men and women and resilience mediated this relationship only in women.