Background and Aims Functional abdominal pain disorders (FAPDs) are more prevalent in females. Dietary fiber may alleviate FAPDs symptoms; however, whether this effect is sex-dependent remains unclear. We investigated the sex-dependency of dietary fiber benefit on abdominal pain in children with FAPDs and explored the potential involvement of the gut microbiome. Methods In two cross-sectional cohorts of children with FAPDs (n=209) and healthy controls (HC; n=105), we correlated dietary fiber intake with abdominal pain symptoms after stratifying by sex. We also performed sex-stratified and sex-interaction analysis on data from a double-blind trial in children with irritable bowel syndrome (IBS) randomized to psyllium fiber (n=39) or placebo (n=49) for six weeks. Shotgun metagenomics was used to investigate gut microbiome community changes potentially linking dietary fiber intake with abdominal pain. Results In the cross-sectional cohorts, fiber intake inversely correlated with pain symptoms in boys (pain episodes: r= -0.24, P=0.005; pain days: r= -0.24, P=0.004) but not in girls. Similarly, in the randomized trial, psyllium fiber reduced the number of pain episodes in boys (P=.012), but not in girls. Generalized linear regression models confirmed that boys treated with psyllium fiber had greater reduction in pain episodes than girls (P=.007 for fiber x sex x time interaction). Age, sexual development, IBS subtype, stool form and microbiome composition were not significant determinants in the dietary fiber effects on pain reduction. Conclusions Dietary fiber preferentially reduces abdominal pain frequency in boys, highlighting the importance of considering sex in future dietary intervention studies for FAPDs. ClincialTrials.gov number, NCT00526903