Background and Aim: Data are lacking on predicting inpatient mortality (IM) in patients admitted for inflammatory bowel disease (IBD). IM is a critical outcome; however, difficulty in its prediction exists due to infrequent occurrence. We assessed IM predictors and developed a predictive model for IM using machine-learning (ML). Methods: Using the National Inpatient Sample (NIS) database (2005)(2006)(2007)(2008)(2009)(2010)(2011)(2012)(2013)(2014)(2015)(2016)(2017), we extracted adults admitted for IBD. After ML-guided predictor selection, we trained and internally validated multiple algorithms, targeting minimum sensitivity and positive likelihood ratio (+LR) ≥ 80% and ≥ 3, respectively. Diagnostic odds ratio (DOR) compared algorithm performance. The best performing algorithm was additionally trained and validated for an IBD-related surgery sub-cohort. External validation was done using NIS 2018. Results: In 398 426 adult IBD admissions, IM was 0.32% overall, and 0.87% among the surgical cohort (n = 40 784). Increasing age, ulcerative colitis, IBD-related surgery, pneumonia, chronic lung disease, acute kidney injury, malnutrition, frailty, heart failure, blood transfusion, sepsis/septic shock and thromboembolism were associated with increased IM. The QLattice algorithm, provided the highest performance model (+LR: 3.2, 95% CI 3.0-3.3; area-under-curve [AUC]:0.87, 85% sensitivity, 73% specificity), distinguishing IM patients by 15.6-fold when comparing high to low-risk patients. The surgical cohort model (+LR: 8.5, AUC: 0.94, 85% sensitivity, 90% specificity), distinguished IM patients by 49-fold. Both models performed excellently in external validation. An online calculator (https://clinicalc.ai/im-ibd/) was developed allowing bedside model predictions. Conclusions: An online prediction-model calculator captured > 80% IM cases during personal conflict of interest to disclose. Arkady Broder has no financial or personal conflict of interest to disclose. Olivier Elemento discloses grant support from Janssen, Johnson and Johnson, Volastra Therapeutics, AstraZeneca and Eli Lilly research grants as well as membership to scientific advisory board and equity holding in Freenome, Owkin, Volastra Therapeutics and One Three Biotech. Dana Lukin discloses consulting for Abbvie,