Introduction: Irritable bowel syndrome (IBS) is characterized as a disorder of the gut–brain interaction (DGBI). Here, we explored the presence of problems related to executive function (EF) in patients with IBS and tested the relative importance of cognitive features involved in EF. Methods: A total of 44 patients with IBS and 22 healthy controls (HCs) completed the Behavior Rating Inventory of Executive Function (BRIEF-A), used to identify nine EF features. The PyCaret 3.0 machine-learning library in Python was used to explore the data, generate a robust model to classify patients with IBS versus HCs and identify the relative importance of the EF features in this model. The robustness of the model was evaluated by training the model on a subset of data and testing it on the unseen, hold-out dataset. Results: The explorative analysis showed that patients with IBS reported significantly more severe EF problems than the HC group on measures of working memory function, initiation, cognitive flexibility and emotional control. Impairment at a level in need of clinical attention was found in up to 40% on some of these scales. When the nine EF features were used as input to a collection of different binary classifiers, the Extreme Gradient Boosting algorithm (XGBoost) showed superior performance. The working memory subscale was consistently selected with the strongest importance in this model, followed by planning and emotional control. The goodness of the machine-learning model was confirmed in an unseen dataset by correctly classifying 85% of the IBS patients. Conclusions: The results showed the presence of EF-related problems in patients with IBS, with a substantial impact of problems related to working memory function. These results suggest that EF should be part of an assessment procedure when a patient presents other symptoms of IBS and that working memory function should be considered a target when treating patients with the disorder. Further studies should include measures of EF as part of the symptom cluster characterizing patients with IBS and other DGBIs.