PurposeSpontaneous bacterial peritonitis (SBP) is a bacterial infection of ascitic fluid that develops naturally, without being triggered by any surgical conditions or procedures, and is a common complication of cirrhosis. With a potential mortality rate of 40 %, accurate diagnosis and prompt initiation of appropriate antibiotic therapy are crucial for optimizing patient outcomes and preventing life-threatening complications. This study aimed to expand the use of computational models to improve the diagnostic accuracy of SBP in cirrhotic patients by incorporating a broader range of data, including clinical variables and laboratory values. Patients and methodsWe employed 5 machine learning classification methods - Decision Tree, Support Vector Machine, Naive Bayes, K-Nearest Neighbor, and Random Forest, utilizing a variety of demographic, clinical, and laboratory features and biomarkers. ResultsAscitic fluid markers, including white blood cell (WBC) count, lactate dehydrogenase (LDH), total protein, and polymorphonuclear cells (PMN), significantly differentiated between SBP and non-SBP patients. The Random Forest model demonstrated the highest overall accuracy at 86 %, while the Naive Bayes model achieved the highest sensitivity at 72 %. Utilizing 10 key features instead of the full feature set improved model performance, notably enhancing specificity and accuracy. ConclusionOur analysis highlights the potential of machine learning to enhance the accuracy of SBP diagnosis in cirrhotic patients. Integrating these models into clinical workflows could substantially improve patient outcomes. To achieve this, ongoing multidisciplinary research is crucial. Ensuring model interpretability, continuous monitoring, and rigorous validation will be essential for the successful implementation of real-time clinical decision support systems.