Vitamin D plays a role in regulating immune homeostasis, inflammation and has an impact on the pathogenesis of inflammatory bowel diseases (IBD). IBD has a multifactorial pathogenesis primarily associated with immune dysregulation, dysbiosis, structurally altered intestinal mucosa, and genetic factors. The immunomodulatory function of this vitamin is linked to its control over innate and adaptive immunity, facilitated through its nuclear vitamin D receptor, leading to the inhibition of nuclear factor kappa-B. This study aimed to investigate serum vitamin D levels in patients with IBD compared to healthy individuals and to evaluate the relationship between vitamin D and inflammatory markers. Cross-sectional study. The study included 106 participants divided into 2 groups: patients with IBD (92), and healthy controls (14). The diagnosis of IBD was based on clinical, laboratory, fecal, endoscopic, and histological findings, following the European guidelines for diagnosis and follow-up ECCO-ESGAR guidelines for diagnostic assessment of IBD from 2019. Serum vitamin D levels were measured along with laboratory tests, imaging, and endoscopic examinations. IBD activity was evaluated using the Montreal classification and clinical and endoscopic indices. Data analysis involved calculating the mean, minimum, and maximum values, standard deviation, and Pearson coefficient. The level of statistical significance for this study was set at P < .05. The study found a prevalence of vitamin D deficiency in 32.6% of patients with IBD, while 66.3% had insufficiency, as compared with healthy individuals. The mean levels of vitamin D in UC and CD were 16 ± 8.6 ng/mL, whereas in the control healthy group, they were 26 ± 9.73 ng/mL. A statistically significant reverse correlation was observed between lower vitamin D levels and higher levels of the inflammatory markers. The study concluded that IBD patients exhibit lower levels of vitamin D, which is associated with inflammation and may contribute to the pathogenesis of the disease.