Despite several studies on the link between dietary inflammatory potential and risk of several conditions, limited studies investigated the association between pro-inflammatory diet and ulcerative colitis (UC). The objective of the present study was to examine the link between food-based dietary inflammatory potential (FDIP) and odds of UC in Iranian adults. This case–control study was carried out among 109 cases and 218 randomly chosen healthy controls. UC was diagnosed and confirmed by a gastroenterologist. Patients with this condition were recruited from Iranian IBD registry. Age- and sex-matched controls were selected randomly from participants of a large cross-sectional study. Dietary data were obtained using a validated 106-item semi-quantitative food frequency questionnaire (FFQ). We calculated FDIP score using subjects’ dietary intakes of 28 pre-defined food groups. In total 67% of subjects were female. There was no significant difference in mean age between cases and controls (39.5 vs. 41.5y; p = 0.12). The median (interquartile range) of FDIP scores for cases and controls were − 1.36(3.25) and − 1.54(3.15), respectively. We found no significant association between FDIP score and UC in the crude model (OR 0.93; 95% CIs 0.53–1.63). Adjustment for several potential confounders in multivariate model did not change this association (OR 1.12; 95% CIs 0.46–2.71). We failed to observe any significant association between greater adherence to a pro-inflammatory diet and risk of UC in this study. Prospective cohort studies are needed to further assess this relationship.