Introduction The incidence of osteoporosis in patients with inflammatory bowel disease (IBD) varies across different populations. Objectives The aim of this study was to evaluate the prevalence of osteoporosis in Polish patients with IBD, as well as the effect of the body mass index (BMI), disease duration, the number of hospital stays, and the use of glucocorticoids on bone mineral density (BMD). Patients and methods BMD of 208 patients with IBD (103 with Crohn disease [CD] and 105 with ulcerative colitis [UC]) and 41 healthy controls was measured using dual‑energy X‑ray absorptiometry. The association of BMD with the other parameters was analyzed using statistical methods. Results Osteoporosis of the lumbar (L2-L4) spine (T‑score) was observed in 11.7% of patients with CD and in 3.8% of those with UC, whereas that of the femoral neck (FN), in 5.8% and 2.9% of the patients with CD and UC, respectively. Osteopenia occurred in 35.9% (FN) and 36.9% (L2-L4) of CD patients, and in 25.7% (FN) and 29.5% (L2-L4) of UC patients. In CD patients, BMI was associated with lumbar and femoral BMD and with L2-L4 T‑score, whereas FN T‑score correlated with BMI. In UC patients, the cumulative glucocorticoid dose correlated with L2-L4 T‑score, FN BMD, FN T‑score, and FN Z‑score; the disease duration correlated with FN BMD, while the FN T‑score, with the number of hospital stays and FN BMD. Conclusions Osteoporosis and osteopenia are frequent in Polish patients with IBD. BMD correlated with BMI in all patients. In UC patients, BMD was associated with the cumulative glucocorticoid dose, disease duration, and number of hospital stays.