Background The incidence of inflammatory bowel disease (IBD) increases, and thus is more common, in pregnant women. IBD is a risk factor for venous thromboembolism (VTE) but it is not clear whether IBD predisposes women to an excess risk of VTE during pregnancy and the postpartum period. Methods This was a nationwide population-based cohort study of all deliveries during 1980-2013 in Denmark, using data from two nationwide health registries: the Danish National Patient Registry and the Medical Birth Registry. We computed incidence rates (IRs) per 1000 person-years, and crude and adjusted relative risks (RRs) with 95% confidence intervals (CIs) for VTE during pregnancy and the first 12 postpartum weeks in women with and without IBD. Results We included 1 046 754 women with 1 978 701 deliveries. We identified 3465 VTE events during pregnancy and 1302 VTE events postpartum. The IR for VTE during pregnancy was 4.20 (95% CI, 2.83-5.58) in IBD patients and 2.41 (95% CI, 2.33-2.50) in women without IBD, corresponding to an RR of 1.72 (95% CI, 1.22-2.43). Adjustment for maternal age and smoking (pregnancies during 1991-2013) yielded an adjusted RR of 1.67 (95% CI, 1.15-2.41). IBD flare was associated with an RR of 2.64 (95% CI, 1.69-4.14) for VTE during pregnancy. The IR for postpartum VTE was 7.03 (95% CI, 3.87-10.20) among IBD patients and 2.88 (95% CI, 2.72-3.04) in women without IBD, corresponding to an adjusted RR of 2.10 (95% CI, 1.33-3.30). Conclusions IBD is a risk factor for VTE during pregnancy and postpartum.